aboutsummaryrefslogtreecommitdiff
path: root/testes/db.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-04-23 11:36:09 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-04-23 11:36:09 -0300
commit9b014d4bcd4ebadb523f1c1a1d38148d8526e5ed (patch)
tree50d7ec68ff36d2fa017b970b11985c6cce5861aa /testes/db.lua
parent50fd8d03c33bbe52ac5b34c4eb748197b349cedd (diff)
downloadlua-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.lua12
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)
432end 432end
433 433
434-- testing iteraction between multiple values x hooks 434-- testing interaction between multiple values x hooks
435do 435do
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)
587assert(t.a == 1 and t.b == 2 and t.c == 3) 587assert(t.a == 1 and t.b == 2 and t.c == 3)
588assert(debug.setupvalue(foo1, 1, "xuxu") == "b") 588assert(debug.setupvalue(foo1, 1, "xuxu") == "b")
589assert(({debug.getupvalue(foo2, 3)})[2] == "xuxu") 589assert(({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)
591assert(debug.getupvalue(string.gmatch("x", "x"), 1) == "") 591assert(debug.getupvalue(string.gmatch("x", "x"), 1) == "")
592 592
593 593
@@ -839,7 +839,7 @@ t[1] = "'error'"
839checktraceback(co, t) 839checktraceback(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
845local function g(x) 845local function g(x)
@@ -966,9 +966,9 @@ local debug = require'debug'
966local a = 12 -- a local variable 966local a = 12 -- a local variable
967 967
968local n, v = debug.getlocal(1, 1) 968local n, v = debug.getlocal(1, 1)
969assert(n == "(temporary)" and v == debug) -- unkown name but known value 969assert(n == "(temporary)" and v == debug) -- unknown name but known value
970n, v = debug.getlocal(1, 2) 970n, v = debug.getlocal(1, 2)
971assert(n == "(temporary)" and v == 12) -- unkown name but known value 971assert(n == "(temporary)" and v == 12) -- unknown name but known value
972 972
973-- a function with an upvalue 973-- a function with an upvalue
974local f = function () local x; return a end 974local 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
1022end 1022end
1023 1023
1024do -- tests for 'source' in binary dumps 1024do -- tests for 'source' in binary dumps