aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-04-10 12:58:14 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-04-10 12:58:14 -0300
commit8ba4523cccf59093543cec988b07957193d55692 (patch)
tree761eb3efbdbe54372d8d5486c2469c337be1f8a8 /testes
parent979ad95eb114d8d43f928b184f051ac0cfacedf7 (diff)
downloadlua-8ba4523cccf59093543cec988b07957193d55692.tar.gz
lua-8ba4523cccf59093543cec988b07957193d55692.tar.bz2
lua-8ba4523cccf59093543cec988b07957193d55692.zip
'print' does not call 'tostring' to format its arguments
Diffstat (limited to 'testes')
-rw-r--r--testes/calls.lua15
1 files changed, 0 insertions, 15 deletions
diff --git a/testes/calls.lua b/testes/calls.lua
index 941493b1..56a12ae6 100644
--- a/testes/calls.lua
+++ b/testes/calls.lua
@@ -21,21 +21,6 @@ assert(type(f) == 'function')
21assert(not pcall(type)) 21assert(not pcall(type))
22 22
23 23
24do -- test error in 'print' too...
25 local tostring = _ENV.tostring
26
27 _ENV.tostring = nil
28 local st, msg = pcall(print, 1)
29 assert(st == false and string.find(msg, "attempt to call a nil value"))
30
31 _ENV.tostring = function () return {} end
32 local st, msg = pcall(print, 1)
33 assert(st == false and string.find(msg, "must return a string"))
34
35 _ENV.tostring = tostring
36end
37
38
39-- testing local-function recursion 24-- testing local-function recursion
40fact = false 25fact = false
41do 26do