From 366c85564874d560b3608349f752e9e490f9002d Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 4 Jul 2024 17:11:58 -0300 Subject: lua.c loads 'readline' dynamically (See comments in luaconf.h.) This change allows easier compilation, as Lua compiles and works even if the package 'readline' is absent from the system. Moreover, non-interactive uses don't load the library, making the stand-alone slightly faster for small loads. --- testes/main.lua | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'testes') diff --git a/testes/main.lua b/testes/main.lua index 5c7d0a10..9a86fb5a 100644 --- a/testes/main.lua +++ b/testes/main.lua @@ -368,20 +368,18 @@ assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt)) -- non-string prompt -prompt = - "local C = 0;\z - _PROMPT=setmetatable({},{__tostring = function () \z - C = C + 1; return C end})" +prompt = [[ + local C = 'X'; + _PROMPT=setmetatable({},{__tostring = function () + C = C .. 'X'; return C end}) +]] prepfile[[ -- a = 2 ]] RUN([[lua -e "%s" -i < %s > %s]], prompt, prog, out) local t = getoutput() -assert(string.find(t, [[ -1 -- -2a = 2 -3 -]], 1, true)) +-- skip version line and then check the presence of the three prompts +assert(string.find(t, "^.-\nXX[^\nX]*\n?XXX[^\nX]*\n?XXXX\n?$")) -- test for error objects -- cgit v1.2.3-55-g6feb