Skip to content

Commit 5e11297

Browse files
author
Joshua Goller
committed
clean up undecl test
1 parent d6dc242 commit 5e11297

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

ch-5/decl/undecl-test.sh

+20
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,39 @@
11
#!/bin/bash
22

33
# char* x()
4+
echo "In: x () * char"
5+
echo "Expected: char* x()"
6+
printf "Actual: "
47
echo "x () * char" | ./bin/undecl | grep "char\* x()"
8+
printf "\n"
59

610
# char x[]
11+
echo "In: x [] char"
12+
echo "Expected: char x[]"
13+
printf "Actual: "
714
echo "x [] char" | ./bin/undecl | grep "char x\[\]"
15+
printf "\n"
816

917
# char (*x)()
1018
# declare x as pointer to function returning char
19+
echo "In: x * () char"
20+
echo "Expected: char (*x)()"
21+
printf "Actual: "
1122
echo "x * () char" | ./bin/undecl | grep "char (\*x)()"
23+
printf "\n"
1224

1325
# char (*(*x())[])()
1426
# declare x as function returning pointer to array of pointer to function returning char
27+
echo "In: x () * [] * () char"
28+
echo "Expected: char (*(*x())[])()"
29+
printf "Actual: "
1530
echo "x () * [] * () char" | ./bin/undecl | grep "char (\*(\*x())\[\])()"
31+
printf "\n"
1632

1733
# char** (*x)()
1834
# declare x as pointer to function returning pointer to pointer to char
35+
echo "In: x * () * * char"
36+
echo "Expected: char **(*x)()"
37+
printf "Actual: "
1938
echo "x * () * * char" | ./bin/undecl | grep "char \*\*(\*x)()"
39+
printf "\n"

0 commit comments

Comments
 (0)