diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-13 13:16:53 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-03-13 13:16:53 -0300 |
commit | cf71a5ddc742692fad813f89f1c9ef53e1ffde0f (patch) | |
tree | df02305ff3cf05908f21829384e3a7f8699d2331 /testes/strings.lua | |
parent | 2c32bff60987d38a60a58d4f0123f3783da60a63 (diff) | |
download | lua-cf71a5ddc742692fad813f89f1c9ef53e1ffde0f.tar.gz lua-cf71a5ddc742692fad813f89f1c9ef53e1ffde0f.tar.bz2 lua-cf71a5ddc742692fad813f89f1c9ef53e1ffde0f.zip |
Details
Several small improvements (code style, warnings, comments, more tests),
in particular:
- 'lua_topointer' extended to handle strings
- raises an error in 'string.format("%10q")' ('%q' with modifiers)
- in the manual for 'string.format', the term "option" replaced by
"conversion specifier" (the term used by the C standard)
Diffstat (limited to '')
-rw-r--r-- | testes/strings.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/testes/strings.lua b/testes/strings.lua index 88480924..da53a87e 100644 --- a/testes/strings.lua +++ b/testes/strings.lua | |||
@@ -199,6 +199,7 @@ end | |||
199 | 199 | ||
200 | assert(string.format("\0%s\0", "\0\0\1") == "\0\0\0\1\0") | 200 | assert(string.format("\0%s\0", "\0\0\1") == "\0\0\0\1\0") |
201 | checkerror("contains zeros", string.format, "%10s", "\0") | 201 | checkerror("contains zeros", string.format, "%10s", "\0") |
202 | checkerror("cannot have modifiers", string.format, "%10q", "1") | ||
202 | 203 | ||
203 | -- format x tostring | 204 | -- format x tostring |
204 | assert(string.format("%s %s", nil, true) == "nil true") | 205 | assert(string.format("%s %s", nil, true) == "nil true") |