aboutsummaryrefslogtreecommitdiff
path: root/testes/db.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-16 14:58:02 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-08-16 14:58:02 -0300
commitb96b0b5abbf40cbdbed7952bf35a5a27ddf75928 (patch)
tree5d9d5463cb7d3424833abab20dd87bce1f4b240f /testes/db.lua
parentca13be9af784b7288d3a07d9b5bccb329086e885 (diff)
downloadlua-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.lua6
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
353debug.sethook(nil); 353debug.sethook(nil);
354assert(debug.gethook() == nil) 354assert(not debug.gethook())
355 355
356 356
357-- minimal tests for setuservalue/getuservalue 357-- minimal tests for setuservalue/getuservalue
358do 358do
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)
362end 362end
@@ -414,7 +414,7 @@ end, "c")
414a:f(1,2,3,4,5) 414a:f(1,2,3,4,5)
415assert(X.self == a and X.a == 1 and X.b == 2 and X.c == nil) 415assert(X.self == a and X.a == 1 and X.b == 2 and X.c == nil)
416assert(XX == 12) 416assert(XX == 12)
417assert(debug.gethook() == nil) 417assert(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)