From 8ba4523cccf59093543cec988b07957193d55692 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Wed, 10 Apr 2019 12:58:14 -0300 Subject: 'print' does not call 'tostring' to format its arguments --- testes/calls.lua | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'testes') 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') assert(not pcall(type)) -do -- test error in 'print' too... - local tostring = _ENV.tostring - - _ENV.tostring = nil - local st, msg = pcall(print, 1) - assert(st == false and string.find(msg, "attempt to call a nil value")) - - _ENV.tostring = function () return {} end - local st, msg = pcall(print, 1) - assert(st == false and string.find(msg, "must return a string")) - - _ENV.tostring = tostring -end - - -- testing local-function recursion fact = false do -- cgit v1.2.3-55-g6feb