Skip to content

Commit 48bd0b4

Browse files
committed
move tests not required by the PDF into folder called extra
This it to prevent confusion on what is mandatory. A lot of people are running the tester and the vague PDF combined with tests not being well organized, creates pure chaos. We should aim to improve the overall minishell experience, by removing as much vagueness as possible from the project!
1 parent f99b483 commit 48bd0b4

File tree

10 files changed

+210
-184
lines changed

10 files changed

+210
-184
lines changed

cmds/extra/1_extra.sh

Lines changed: 161 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,161 @@
1+
# echo external
2+
/bin/echo \$USER
3+
4+
/bin/echo \\$USER
5+
6+
/bin/echo \\\$USER
7+
8+
/bin/echo \\\\$USER
9+
10+
/bin/echo \\\\\$USER
11+
12+
/bin/echo \\\\\\\\\$USER
13+
14+
/bin/echo \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\$USER \$PATH \\$PWD
15+
16+
# echo builtin
17+
echo \$USER
18+
19+
echo \\$USER
20+
21+
echo \\\$USER
22+
23+
echo \\\\$USER
24+
25+
echo \\\\\$USER
26+
27+
echo \\\\\\\\\$USER
28+
29+
echo \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\$USER \$PATH \\$PWD
30+
31+
# cd
32+
cd --
33+
34+
cd ../../
35+
cd -
36+
cd -
37+
38+
echo cd ~
39+
echo "cd ~"
40+
41+
pwd
42+
cd ~
43+
cd - ananas dot jpeg
44+
pwd
45+
46+
pwd
47+
cd ~ asd w dd q asd
48+
pwd
49+
50+
pwd
51+
cd ~
52+
cd -
53+
pwd
54+
55+
pwd
56+
cd -
57+
pwd
58+
59+
pwd
60+
cd ~
61+
pwd
62+
63+
cd '/////' 2>/dev/null
64+
65+
cd "doesntexist" 2>/dev/null
66+
67+
cd "wtf" 2>/dev/null
68+
69+
# env
70+
env what
71+
72+
# export
73+
export -TEST=100
74+
75+
export --TEST=123
76+
77+
# the ordering of export doesn't matter,
78+
# for declare to still work
79+
export
80+
81+
export TEST+=100
82+
83+
# unset
84+
unset TES;T
85+
86+
unset -TEST
87+
88+
# pipes
89+
ls | cat << stop | ls -la | cat << stop1 | ls | cat << stop2 | ls -la > > out | cat << stop3
90+
fe
91+
wf
92+
fwe
93+
f
94+
stop
95+
dw
96+
stop1
97+
dwasd
98+
stop2
99+
cat Makefile | ls > out
100+
cat out
101+
/bin/rm -f out
102+
103+
/bin/env | grep "_="
104+
105+
/bin/env | grep "SHLVL"
106+
107+
# scmds
108+
touch "
109+
"
110+
/bin/rm -f "
111+
"
112+
113+
# path fails
114+
unset PATH
115+
echo $PATH
116+
/bin/ls
117+
echo 1
118+
cd -
119+
echo 42
120+
121+
env -i ./minishell
122+
cd /bin/
123+
ls
124+
125+
pwd
126+
cd ~/Desktop/
127+
pwd
128+
129+
# syntax errors
130+
~
131+
132+
.
133+
134+
..
135+
136+
>echo>
137+
/bin/rm -f echo
138+
139+
<echo<
140+
/bin/rm -f echo
141+
142+
>>echo>>
143+
/bin/rm -f echo
144+
145+
\\\
146+
147+
>| echo wtf
148+
/bin/rm -rf echo
149+
150+
# go wild
151+
echo "env | /usr/bin/wc -l" | env -i $MINISHELL_PATH"/"$EXECUTABLE
152+
echo $?
153+
154+
echo "ls" | env -i $MINISHELL_PATH"/"$EXECUTABLE
155+
echo $?
156+
157+
echo "unset PATH" | env -i $MINISHELL_PATH"/"$EXECUTABLE
158+
echo $?
159+
160+
# parsing hell
161+
>| echo sure

cmds/mand/0_compare_parsing.sh

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,6 @@
4949

5050
/bin/echo "'$?'"
5151

52-
/bin/echo \$USER
53-
54-
/bin/echo \\$USER
55-
56-
/bin/echo \\\$USER
57-
58-
/bin/echo \\\\$USER
59-
60-
/bin/echo \\\\\$USER
61-
62-
/bin/echo \\\\\\\\\$USER
63-
64-
/bin/echo \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\$USER \$PATH \\$PWD
65-
6652
/bin/echo "cat lol.c | cat > lol.c"
6753

6854
/bin/echo "cat lol.c '|' cat > lol.c"
@@ -179,4 +165,4 @@
179165

180166
/bin/echo ''totally logical''
181167

182-
/bin/echo ""'totally logical'""
168+
/bin/echo ""'totally logical'""

cmds/mand/10_parsing_hell.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,3 @@ exit 9223372036854775805
315315
exit 123"123"
316316
317317
<| echo ok
318-
319-
>| echo sure
320-
321-
cd --

0 commit comments

Comments
 (0)