-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
After struggling with what seem to be tty driver timing differences, not to mention different people's shell output, I gave in and removed the leading CRLF hack from matching. This means that now no test can have the same trailing input as the output it matches. We're also more careful about signal names.
- Loading branch information
Showing
24 changed files
with
142 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
# binaries | ||
helpers/echo-signal | ||
helpers/echo-exit | ||
helpers/echo-rot13 | ||
helpers/echo-signal | ||
helpers/exit-status-0 | ||
helpers/list-fds | ||
helpers/fd-perms | ||
helpers/list-fds | ||
helpers/timeout |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#if 0 | ||
set -x "$(dirname $0)/$(basename $0 .c)" | ||
exec ${CC:-cc} ${CFLAGS:--Wall -Wextra -g} $0 -o $1 | ||
#endif | ||
|
||
/* Echo our arguments, rot13'd. */ | ||
|
||
#include <errno.h> | ||
#include <spawn.h> | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
#include <sys/types.h> | ||
#include <sys/wait.h> | ||
|
||
static void rot13(char *s) | ||
{ | ||
while (*s) { | ||
char c = *s|32; | ||
if (c >= 'a' && c <= 'm') *s += 13; | ||
else if (c >= 'n' && c <= 'z') *s -= 13; | ||
++s; | ||
} | ||
} | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
for (int i = 1; i < argc; ++i) | ||
rot13(argv[i]); | ||
if (argc > 1) printf("%s", argv[1]); | ||
for (int i = 2; i < argc; ++i) | ||
printf(" %s", argv[i]); | ||
puts(""); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
→ /bin/pwd⏎ | ||
≠ /tmp | ||
→ cd /tmp⏎ | ||
→ cd ..⏎ | ||
→ /bin/pwd⏎ | ||
← /tmp | ||
← / |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,5 +3,5 @@ | |
← foobarbaz | ||
→ cd /tmp; pwd⏎ | ||
← /tmp | ||
→ false; echo foo⏎ | ||
← foo | ||
→ false; echo-rot13 foo⏎ | ||
← sbb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
# POSIX calls these AND Lists and OR Lists | ||
→ true && echo foo⏎ | ||
← foo | ||
→ false && echo foo⏎ | ||
≠ foo | ||
→ true && false && echo foo⏎ | ||
≠ foo | ||
→ false || echo foo⏎ | ||
← foo | ||
→ true || false || echo foo⏎ | ||
≠ foo | ||
→ false || true && echo foo⏎ | ||
← foo | ||
→ true && echo-rot13 foo⏎ | ||
← sbb | ||
→ false && echo-rot13 foo⏎ | ||
≠ sbb | ||
→ true && false && echo-rot13 foo⏎ | ||
≠ sbb | ||
→ false || echo-rot13 foo⏎ | ||
← sbb | ||
→ true || false || echo-rot13 foo⏎ | ||
≠ sbb | ||
→ false || true && echo-rot13 foo⏎ | ||
← sbb | ||
→ nonexistent-command || echo-rot13 zim⏎ | ||
← mvz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
→ ! false && echo foo⏎ | ||
← foo | ||
→ ! true && echo foo⏎ | ||
≠ foo | ||
→ ! true || echo foo⏎ | ||
← foo | ||
→ ! false && echo-rot13 foo⏎ | ||
← sbb | ||
→ ! true && echo-rot13 foo⏎ | ||
≠ sbb | ||
→ ! true || echo-rot13 foo⏎ | ||
← sbb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
→ true &&⏎false ||⏎echo foo ||⏎echo bar⏎ | ||
← foo | ||
→ true &&⏎false ||⏎echo-rot13 foo ||⏎echo-rot13 bar⏎ | ||
← sbb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# This will hang in the case of a very common bug: you forget to close | ||
# the other ends of the pipe. | ||
→ cat </etc/passwd | cat | cat | cat >/dev/null | echo foo⏎ | ||
← foo | ||
→ cat </etc/passwd | cat | cat | cat >/dev/null | echo-rot13 foo⏎ | ||
← sbb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
# Would prefer to test this but mksh doesn't agree | ||
#→ echo zim | ! tr z b | grep -qc bim || echo foo⏎ | ||
#≠ foo | ||
→ ! echo zim | tr z b | grep -qc bim || echo foo⏎ | ||
← foo | ||
→ ! echo zim | tr z b | grep -qc bim || echo-rot13 foo⏎ | ||
← sbb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
→ echo foo | cd /tmp | pwd⏎ | ||
≠ /tmp | ||
→ echo foo | cd /tmp | echo bar⏎ | ||
← bar | ||
→ echo foo | cd /tmp | echo-rot13 bar⏎ | ||
← one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
# this would be nicer if we already had $@... | ||
→ echo-signal 2⏎ | ||
→ echo-signal INT⏎ | ||
← ready | ||
→ ^C⏎ | ||
← 2 | ||
→ cat⏎ | ||
→ ^\⏎echo foo⏎ | ||
← foo | ||
→ echo-signal 20⏎ | ||
← INT | ||
→ echo-signal TSTP⏎ | ||
← ready | ||
→ ^Z⏎ | ||
← 20 | ||
← TSTP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,14 @@ | ||
→ echo-signal 18⏎ | ||
→ echo-signal CONT⏎ | ||
← ready | ||
→ ^Z | ||
→ echo foo⏎ | ||
← foo | ||
→ echo-rot13 foo⏎ | ||
← sbb | ||
→ fg⏎ | ||
← 18 | ||
→ echo-signal 2 &⏎ | ||
→ echo foo⏎ | ||
← foo | ||
← CONT | ||
→ echo-signal INT &⏎ | ||
← ready | ||
→ echo-rot13 foo⏎ | ||
← sbb | ||
→ fg⏎ | ||
→ ^C⏎ | ||
← 2 | ||
← INT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
→ echo-signal 2 & echo foo⏎ | ||
← foo | ||
→ echo-signal INT & sleep 1; echo-rot13 foo⏎ | ||
← ready | ||
← sbb | ||
→ fg⏎ | ||
→ ^C⏎ | ||
← 2 | ||
← INT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
→ cat⏎^\⏎echo foo⏎ | ||
← foo | ||
→ cat⏎^\⏎echo-rot13 foo⏎ | ||
← sbb | ||
→ ^\^\echo-rot13 blah⏎ | ||
← oynu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
→ e'ch'o foo⏎ | ||
← foo | ||
→ ''''""/"b"i'n/e'"c"ho''"" yup⏎ | ||
→ ''''""/"b"i'n/e'"c"ho''"" yup; true⏎ | ||
← yup | ||
→ ""'echo'"-"rot1'3' yup⏎ | ||
← lhc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
→ echo ~⏎ | ||
→ echo ~; true⏎ | ||
≠ ~ | ||
# XXX this will vary by system; use magic. | ||
→ echo ~root⏎ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# not POSIX | ||
→ touch foo bar⏎ | ||
→ ech^I f^I b^I⏎ | ||
← foo bar | ||
→ ech^I-rot^I f^I b^I⏎ | ||
← sbb one |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
→ echo foo⏎ | ||
← foo | ||
→ echo bar⏎ | ||
→ echo-rot13 foo⏎ | ||
← sbb | ||
→ echo-rot13 bar⏎ | ||
← one | ||
→ ⇑⇑⏎ | ||
← foo | ||
← sbb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
→ true⏎ | ||
→ echo foo⏎ | ||
← foo | ||
→ echo bar⏎ | ||
← bar | ||
→ echo-rot13 foo⏎ | ||
← sbb | ||
→ echo-rot13 bar⏎ | ||
← one | ||
→ ^Rf⏎ | ||
← foo | ||
← sbb |