diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-16 14:58:02 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2019-08-16 14:58:02 -0300 |
commit | b96b0b5abbf40cbdbed7952bf35a5a27ddf75928 (patch) | |
tree | 5d9d5463cb7d3424833abab20dd87bce1f4b240f /testes/strings.lua | |
parent | ca13be9af784b7288d3a07d9b5bccb329086e885 (diff) | |
download | lua-b96b0b5abbf40cbdbed7952bf35a5a27ddf75928.tar.gz lua-b96b0b5abbf40cbdbed7952bf35a5a27ddf75928.tar.bz2 lua-b96b0b5abbf40cbdbed7952bf35a5a27ddf75928.zip |
Added macro 'luaL_pushfail'
The macro 'luaL_pushfail' documents all places in the standard libraries
that return nil to signal some kind of failure. It is defined as
'lua_pushnil'. The manual also got a notation (@fail) to document those
returns. The tests were changed to be agnostic regarding whether 'fail'
is 'nil' or 'false'.
Diffstat (limited to 'testes/strings.lua')
-rw-r--r-- | testes/strings.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testes/strings.lua b/testes/strings.lua index 2e0e160f..97875ec0 100644 --- a/testes/strings.lua +++ b/testes/strings.lua | |||
@@ -56,13 +56,13 @@ a,b = string.find("123456789", "345") | |||
56 | assert(string.sub("123456789", a, b) == "345") | 56 | assert(string.sub("123456789", a, b) == "345") |
57 | assert(string.find("1234567890123456789", "345", 3) == 3) | 57 | assert(string.find("1234567890123456789", "345", 3) == 3) |
58 | assert(string.find("1234567890123456789", "345", 4) == 13) | 58 | assert(string.find("1234567890123456789", "345", 4) == 13) |
59 | assert(string.find("1234567890123456789", "346", 4) == nil) | 59 | assert(not string.find("1234567890123456789", "346", 4)) |
60 | assert(string.find("1234567890123456789", ".45", -9) == 13) | 60 | assert(string.find("1234567890123456789", ".45", -9) == 13) |
61 | assert(string.find("abcdefg", "\0", 5, 1) == nil) | 61 | assert(not string.find("abcdefg", "\0", 5, 1)) |
62 | assert(string.find("", "") == 1) | 62 | assert(string.find("", "") == 1) |
63 | assert(string.find("", "", 1) == 1) | 63 | assert(string.find("", "", 1) == 1) |
64 | assert(not string.find("", "", 2)) | 64 | assert(not string.find("", "", 2)) |
65 | assert(string.find('', 'aaa', 1) == nil) | 65 | assert(not string.find('', 'aaa', 1)) |
66 | assert(('alo(.)alo'):find('(.)', 1, 1) == 4) | 66 | assert(('alo(.)alo'):find('(.)', 1, 1) == 4) |
67 | 67 | ||
68 | assert(string.len("") == 0) | 68 | assert(string.len("") == 0) |