diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-04-23 11:36:09 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2025-04-23 11:36:09 -0300 |
| commit | 9b014d4bcd4ebadb523f1c1a1d38148d8526e5ed (patch) | |
| tree | 50d7ec68ff36d2fa017b970b11985c6cce5861aa /testes/db.lua | |
| parent | 50fd8d03c33bbe52ac5b34c4eb748197b349cedd (diff) | |
| download | lua-9b014d4bcd4ebadb523f1c1a1d38148d8526e5ed.tar.gz lua-9b014d4bcd4ebadb523f1c1a1d38148d8526e5ed.tar.bz2 lua-9b014d4bcd4ebadb523f1c1a1d38148d8526e5ed.zip | |
Details (typos in comments)
Diffstat (limited to 'testes/db.lua')
| -rw-r--r-- | testes/db.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/testes/db.lua b/testes/db.lua index 8e13373c..e4982c20 100644 --- a/testes/db.lua +++ b/testes/db.lua | |||
| @@ -431,7 +431,7 @@ do | |||
| 431 | assert(a == nil and not b) | 431 | assert(a == nil and not b) |
| 432 | end | 432 | end |
| 433 | 433 | ||
| 434 | -- testing iteraction between multiple values x hooks | 434 | -- testing interaction between multiple values x hooks |
| 435 | do | 435 | do |
| 436 | local function f(...) return 3, ... end | 436 | local function f(...) return 3, ... end |
| 437 | local count = 0 | 437 | local count = 0 |
| @@ -587,7 +587,7 @@ t = getupvalues(foo2) | |||
| 587 | assert(t.a == 1 and t.b == 2 and t.c == 3) | 587 | assert(t.a == 1 and t.b == 2 and t.c == 3) |
| 588 | assert(debug.setupvalue(foo1, 1, "xuxu") == "b") | 588 | assert(debug.setupvalue(foo1, 1, "xuxu") == "b") |
| 589 | assert(({debug.getupvalue(foo2, 3)})[2] == "xuxu") | 589 | assert(({debug.getupvalue(foo2, 3)})[2] == "xuxu") |
| 590 | -- upvalues of C functions are allways "called" "" (the empty string) | 590 | -- upvalues of C functions are always named "" (the empty string) |
| 591 | assert(debug.getupvalue(string.gmatch("x", "x"), 1) == "") | 591 | assert(debug.getupvalue(string.gmatch("x", "x"), 1) == "") |
| 592 | 592 | ||
| 593 | 593 | ||
| @@ -839,7 +839,7 @@ t[1] = "'error'" | |||
| 839 | checktraceback(co, t) | 839 | checktraceback(co, t) |
| 840 | 840 | ||
| 841 | 841 | ||
| 842 | -- test acessing line numbers of a coroutine from a resume inside | 842 | -- test accessing line numbers of a coroutine from a resume inside |
| 843 | -- a C function (this is a known bug in Lua 5.0) | 843 | -- a C function (this is a known bug in Lua 5.0) |
| 844 | 844 | ||
| 845 | local function g(x) | 845 | local function g(x) |
| @@ -966,9 +966,9 @@ local debug = require'debug' | |||
| 966 | local a = 12 -- a local variable | 966 | local a = 12 -- a local variable |
| 967 | 967 | ||
| 968 | local n, v = debug.getlocal(1, 1) | 968 | local n, v = debug.getlocal(1, 1) |
| 969 | assert(n == "(temporary)" and v == debug) -- unkown name but known value | 969 | assert(n == "(temporary)" and v == debug) -- unknown name but known value |
| 970 | n, v = debug.getlocal(1, 2) | 970 | n, v = debug.getlocal(1, 2) |
| 971 | assert(n == "(temporary)" and v == 12) -- unkown name but known value | 971 | assert(n == "(temporary)" and v == 12) -- unknown name but known value |
| 972 | 972 | ||
| 973 | -- a function with an upvalue | 973 | -- a function with an upvalue |
| 974 | local f = function () local x; return a end | 974 | local f = function () local x; return a end |
| @@ -1018,7 +1018,7 @@ do -- bug in 5.4.0: line hooks in stripped code | |||
| 1018 | line = l | 1018 | line = l |
| 1019 | end, "l") | 1019 | end, "l") |
| 1020 | assert(s() == 2); debug.sethook(nil) | 1020 | assert(s() == 2); debug.sethook(nil) |
| 1021 | assert(line == nil) -- hook called withoug debug info for 1st instruction | 1021 | assert(line == nil) -- hook called without debug info for 1st instruction |
| 1022 | end | 1022 | end |
| 1023 | 1023 | ||
| 1024 | do -- tests for 'source' in binary dumps | 1024 | do -- tests for 'source' in binary dumps |
