aboutsummaryrefslogtreecommitdiff
path: root/testes/strings.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-03-13 13:16:53 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-03-13 13:16:53 -0300
commitcf71a5ddc742692fad813f89f1c9ef53e1ffde0f (patch)
treedf02305ff3cf05908f21829384e3a7f8699d2331 /testes/strings.lua
parent2c32bff60987d38a60a58d4f0123f3783da60a63 (diff)
downloadlua-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.lua1
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
200assert(string.format("\0%s\0", "\0\0\1") == "\0\0\0\1\0") 200assert(string.format("\0%s\0", "\0\0\1") == "\0\0\0\1\0")
201checkerror("contains zeros", string.format, "%10s", "\0") 201checkerror("contains zeros", string.format, "%10s", "\0")
202checkerror("cannot have modifiers", string.format, "%10q", "1")
202 203
203-- format x tostring 204-- format x tostring
204assert(string.format("%s %s", nil, true) == "nil true") 205assert(string.format("%s %s", nil, true) == "nil true")