mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 13:52:28 +00:00
Fix upstream Lua test breakage due to Linenoise
This commit is contained in:
parent
65f32fad52
commit
d5a37de435
2 changed files with 28 additions and 18 deletions
31
third_party/lua/test/main.lua
vendored
31
third_party/lua/test/main.lua
vendored
|
@ -285,17 +285,22 @@ a = 2
|
|||
]]
|
||||
RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out)
|
||||
local t = getoutput()
|
||||
assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt))
|
||||
-- <disabled-by-jart>
|
||||
-- [it doesn't make sense to print prompt if !isatty]
|
||||
-- assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt))
|
||||
-- </disabled-by-jart>
|
||||
|
||||
-- using the prompt default
|
||||
-- -- using the prompt default
|
||||
prepfile[[ --
|
||||
a = 2
|
||||
]]
|
||||
RUN([[lua -i < %s > %s]], prog, out)
|
||||
local t = getoutput()
|
||||
prompt = "> " -- the default
|
||||
assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt))
|
||||
|
||||
-- <disabled-by-jart>
|
||||
-- [it doesn't make sense to print prompt if !isatty]
|
||||
-- assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt))
|
||||
-- </disabled-by-jart>
|
||||
|
||||
-- non-string prompt
|
||||
prompt =
|
||||
|
@ -305,13 +310,17 @@ prompt =
|
|||
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) or string.find(t, "123", 1, true))
|
||||
-- <disabled-by-jart>
|
||||
-- [it doesn't make sense to print prompt if !isatty]
|
||||
-- RUN([[lua -e "%s" -i < %s > %s]], prompt, prog, out)
|
||||
-- local t = getoutput()
|
||||
-- assert(string.find(t, [[
|
||||
-- 1 --
|
||||
-- 2a = 2
|
||||
-- 3
|
||||
-- ]], 1, true) or string.find(t, "123", 1, true))
|
||||
-- assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt))
|
||||
-- </disabled-by-jart>
|
||||
|
||||
|
||||
-- test for error objects
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue