summaryrefslogtreecommitdiff
path: root/testes/strings.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-12-17 15:45:13 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-12-17 15:45:13 -0300
commitc646e57fd6307bd891e4e50ef5d6ee56b34e4cac (patch)
treee8f2d8a7bcb9f5c51ddc03f94f576f2fc6f43f06 /testes/strings.lua
parente0ab13c62f2c1af0af955f173beb3ea6473e8064 (diff)
downloadlua-github-c646e57fd6307bd891e4e50ef5d6ee56b34e4cac.tar.gz
Joined common code in 'lua_rawset' and 'lua_rawsetp'
Diffstat (limited to 'testes/strings.lua')
-rw-r--r--testes/strings.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/testes/strings.lua b/testes/strings.lua
index f2f61413..2ce3ebc3 100644
--- a/testes/strings.lua
+++ b/testes/strings.lua
@@ -161,18 +161,21 @@ do -- tests for '%p' format
local null = string.format("%p", nil)
assert(string.format("%p", {}) ~= null)
assert(string.format("%p", 4) == null)
+ assert(string.format("%p", true) == null)
assert(string.format("%p", print) ~= null)
assert(string.format("%p", coroutine.running()) ~= null)
+ assert(string.format("%p", io.stdin) ~= null)
+ assert(string.format("%p", io.stdin) == string.format("%p", io.stdin))
do
local t1 = {}; local t2 = {}
assert(string.format("%p", t1) ~= string.format("%p", t2))
end
- do -- short strings
+ do -- short strings are internalized
local s1 = string.rep("a", 10)
local s2 = string.rep("a", 10)
assert(string.format("%p", s1) == string.format("%p", s2))
end
- do -- long strings
+ do -- long strings aren't internalized
local s1 = string.rep("a", 300); local s2 = string.rep("a", 300)
assert(string.format("%p", s1) ~= string.format("%p", s2))
end