build-your-own-shell icon indicating copy to clipboard operation
build-your-own-shell copied to clipboard

Test for shell's successful exit is implicit and confusing (was: Weird issue with tests?)

Open jeffmc opened this issue 1 year ago • 1 comments

me@DebianXfce23F:~/projects/lsh-shell/build-your-own-shell$ ./validate ../lsh
stage_1: 01-fork-exec.t 
→ /bin/echo foo bar⏎
↵ foo bar
→ tr a-z n-za-m⏎
→ foo bar baz⏎
↵ sbb one onm
→ ^D
→ ./helpers/echo-rot13 foo bar⏎
↵ sbb one
→ ./helpers/echo-exit ./helpers/successful-exit-status⏎
↵ 0

---------------------------
You still need to do stage_1
Keep working!

Unsure where I am actually going wrong here, I think I poorly understand your "validate".

I've attached my C source code if you'd like to look through any of it to detect where I've gone wrong. lsh.c.txt

jeffmc avatar Mar 15 '24 08:03 jeffmc

(Caveat: I'm travelling presently so I may not be able to respond quickly or make a change here)

The problem is what your shell does on EOF: try running it interactively and hitting ^D. Let's leave this issue open though, because the test suite could be a lot clearer here: it should be explicit that we failed while trying to terminate the shell. (It isn't right now since the timeout is implemented separately from the harness).

Thanks for giving the workshop a try!

tokenrove avatar Mar 15 '24 12:03 tokenrove