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-c646e57fd6307bd891e4e50ef5d6ee56b34e4cac.tar.gz lua-c646e57fd6307bd891e4e50ef5d6ee56b34e4cac.tar.bz2 lua-c646e57fd6307bd891e4e50ef5d6ee56b34e4cac.zip |
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 | |||
161 | local null = string.format("%p", nil) | 161 | local null = string.format("%p", nil) |
162 | assert(string.format("%p", {}) ~= null) | 162 | assert(string.format("%p", {}) ~= null) |
163 | assert(string.format("%p", 4) == null) | 163 | assert(string.format("%p", 4) == null) |
164 | assert(string.format("%p", true) == null) | ||
164 | assert(string.format("%p", print) ~= null) | 165 | assert(string.format("%p", print) ~= null) |
165 | assert(string.format("%p", coroutine.running()) ~= null) | 166 | assert(string.format("%p", coroutine.running()) ~= null) |
167 | assert(string.format("%p", io.stdin) ~= null) | ||
168 | assert(string.format("%p", io.stdin) == string.format("%p", io.stdin)) | ||
166 | do | 169 | do |
167 | local t1 = {}; local t2 = {} | 170 | local t1 = {}; local t2 = {} |
168 | assert(string.format("%p", t1) ~= string.format("%p", t2)) | 171 | assert(string.format("%p", t1) ~= string.format("%p", t2)) |
169 | end | 172 | end |
170 | do -- short strings | 173 | do -- short strings are internalized |
171 | local s1 = string.rep("a", 10) | 174 | local s1 = string.rep("a", 10) |
172 | local s2 = string.rep("a", 10) | 175 | local s2 = string.rep("a", 10) |
173 | assert(string.format("%p", s1) == string.format("%p", s2)) | 176 | assert(string.format("%p", s1) == string.format("%p", s2)) |
174 | end | 177 | end |
175 | do -- long strings | 178 | do -- long strings aren't internalized |
176 | local s1 = string.rep("a", 300); local s2 = string.rep("a", 300) | 179 | local s1 = string.rep("a", 300); local s2 = string.rep("a", 300) |
177 | assert(string.format("%p", s1) ~= string.format("%p", s2)) | 180 | assert(string.format("%p", s1) ~= string.format("%p", s2)) |
178 | end | 181 | end |