diff options
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 |
