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/db.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/db.lua')
-rw-r--r-- | testes/db.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testes/db.lua b/testes/db.lua index a64a1130..c43243a6 100644 --- a/testes/db.lua +++ b/testes/db.lua | |||
@@ -351,12 +351,12 @@ assert(g(0,0) == 30) | |||
351 | 351 | ||
352 | 352 | ||
353 | debug.sethook(nil); | 353 | debug.sethook(nil); |
354 | assert(debug.gethook() == nil) | 354 | assert(not debug.gethook()) |
355 | 355 | ||
356 | 356 | ||
357 | -- minimal tests for setuservalue/getuservalue | 357 | -- minimal tests for setuservalue/getuservalue |
358 | do | 358 | do |
359 | assert(debug.setuservalue(io.stdin, 10) == nil) | 359 | assert(not debug.setuservalue(io.stdin, 10)) |
360 | local a, b = debug.getuservalue(io.stdin, 10) | 360 | local a, b = debug.getuservalue(io.stdin, 10) |
361 | assert(a == nil and not b) | 361 | assert(a == nil and not b) |
362 | end | 362 | end |
@@ -414,7 +414,7 @@ end, "c") | |||
414 | a:f(1,2,3,4,5) | 414 | a:f(1,2,3,4,5) |
415 | assert(X.self == a and X.a == 1 and X.b == 2 and X.c == nil) | 415 | assert(X.self == a and X.a == 1 and X.b == 2 and X.c == nil) |
416 | assert(XX == 12) | 416 | assert(XX == 12) |
417 | assert(debug.gethook() == nil) | 417 | assert(not debug.gethook()) |
418 | 418 | ||
419 | 419 | ||
420 | -- testing access to local variables in return hook (bug in 5.2) | 420 | -- testing access to local variables in return hook (bug in 5.2) |