Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jeffmc opened this issue Mar 15, 2024 · 1 comment

Comments

@jeffmc
Copy link

jeffmc commented Mar 15, 2024

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

@tokenrove
Copy link
Owner

(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 tokenrove changed the title Weird issue with tests? Test for shell's successful exit is implicit and confusing (was: Weird issue with tests?) Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants