diff options
Diffstat (limited to 'testes')
-rw-r--r-- | testes/main.lua | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/testes/main.lua b/testes/main.lua index d2d602de..56959abd 100644 --- a/testes/main.lua +++ b/testes/main.lua | |||
@@ -287,6 +287,33 @@ RUN([[lua "-e_PROMPT='%s'" -i < %s > %s]], prompt, prog, out) | |||
287 | local t = getoutput() | 287 | local t = getoutput() |
288 | assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt)) | 288 | assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt)) |
289 | 289 | ||
290 | -- using the prompt default | ||
291 | prepfile[[ -- | ||
292 | a = 2 | ||
293 | ]] | ||
294 | RUN([[lua -i < %s > %s]], prog, out) | ||
295 | local t = getoutput() | ||
296 | prompt = "> " -- the default | ||
297 | assert(string.find(t, prompt .. ".*" .. prompt .. ".*" .. prompt)) | ||
298 | |||
299 | |||
300 | -- non-string prompt | ||
301 | prompt = | ||
302 | "local C = 0;\z | ||
303 | _PROMPT=setmetatable({},{__tostring = function () \z | ||
304 | C = C + 1; return C end})" | ||
305 | prepfile[[ -- | ||
306 | a = 2 | ||
307 | ]] | ||
308 | RUN([[lua -e "%s" -i < %s > %s]], prompt, prog, out) | ||
309 | local t = getoutput() | ||
310 | assert(string.find(t, [[ | ||
311 | 1 -- | ||
312 | 2a = 2 | ||
313 | 3 | ||
314 | ]], 1, true)) | ||
315 | |||
316 | |||
290 | -- test for error objects | 317 | -- test for error objects |
291 | prepfile[[ | 318 | prepfile[[ |
292 | debug = require "debug" | 319 | debug = require "debug" |