[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Testing Lua
- From: Duck <duck@...>
- Date: Fri, 28 Sep 2007 08:29:32 +1000 (EST)
lua: main.lua:31: assertion failed!
stack traceback:
[C]: in function 'assert'
main.lua:31: in function 'checkout'
main.lua:99: in main chunk
(tail call): ?
all.lua:69: in main chunk
[C]: ?
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
do this:
$ lua
and then enter this command:
= 6
then the interpreter will spit out:
6
Which it does.
OK, so I started to automate this myself. Like this:
$ echo '= 6' | lua -i
and Lua spits out:
6
And then:
$ echo '= 6' | lua -i > banana
followed by:
$ cat banana
in which I get the expected:
6
But when I put the '= 6' inside a file (as main.lua does) and do this:
$ lua -i < filecontainingequals6 > banana
and then:
$ cat banana
I get the input echoed, plus the output, like this:
= 6
6
WTF!?!
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 :-)