diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-12-17 15:45:13 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-12-17 15:45:13 -0300 |
| commit | c646e57fd6307bd891e4e50ef5d6ee56b34e4cac (patch) | |
| tree | e8f2d8a7bcb9f5c51ddc03f94f576f2fc6f43f06 /testes/strings.lua | |
| parent | e0ab13c62f2c1af0af955f173beb3ea6473e8064 (diff) | |
| download | lua-github-c646e57fd6307bd891e4e50ef5d6ee56b34e4cac.tar.gz | |
Joined common code in 'lua_rawset' and 'lua_rawsetp'
Diffstat (limited to 'testes/strings.lua')
| -rw-r--r-- | testes/strings.lua | 7 |
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 |
