[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Testing Lua
- From: Duck <duck@...>
- Date: Fri, 28 Sep 2007 08:29:32 +1000 (EST)
lua: main.lua:31: assertion failed!
[C]: in function 'assert'
main.lua:31: in function 'checkout'
main.lua:99: in main chunk
(tail call): ?
all.lua:69: in main chunk
Bah, humbug! I get this, too. Some shell/TERM/readline/redirecton
weirdness? Bash overcoolness?
At this point the test script is typing commands into the Lua interpreter
and seeing that they work. Ignoring the details, ignoring the Lua prompts,
and simplifying to a single command, the script expects to test that if I
and then enter this command:
then the interpreter will spit out:
Which it does.
OK, so I started to automate this myself. Like this:
$ echo '= 6' | lua -i
and Lua spits out:
$ echo '= 6' | lua -i > banana
$ cat banana
in which I get the expected:
But when I put the '= 6' inside a file (as main.lua does) and do this:
$ lua -i < filecontainingequals6 > banana
$ cat banana
I get the input echoed, plus the output, like this:
So I altered main.lua so that the tests which run commands with both stdin
and stdout redirected didn't do 'lua -i < in > out' but instead did 'cat
in | lua -i > out'.
That was OK.
The rest of the tests ran unexceptionally, as I wanted to have no doubt
they were going to :-) (Haven't tried building with ltests.h yet.)
So the failure which I (and Szabo Gabor) seem to have experienced is
related to failure in the _testing_ regime for the interactive Lua
interpreter...when run _by hand_, the relevant tests in main.lua all pass.
What am I doing wrong? (I haven't tried in a differet shell. I need to get
off to work now :-)