mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 20:52:45 +08:00
Added some test cases, not all of which are supported yet
This commit is contained in:
1
badcase/alphaltnum
Normal file
1
badcase/alphaltnum
Normal file
@@ -0,0 +1 @@
|
||||
if [[ $V < 3 ]]; then echo foo; fi
|
1
badcase/dollarassign
Normal file
1
badcase/dollarassign
Normal file
@@ -0,0 +1 @@
|
||||
$FOO=3
|
1
badcase/forinls
Normal file
1
badcase/forinls
Normal file
@@ -0,0 +1 @@
|
||||
for f in `ls *.jpg`; do echo "$f"; done
|
1
badcase/intosame
Normal file
1
badcase/intosame
Normal file
@@ -0,0 +1 @@
|
||||
cat compile.sh |tr -d '\r' > compile.sh
|
1
badcase/missingspacetest
Normal file
1
badcase/missingspacetest
Normal file
@@ -0,0 +1 @@
|
||||
if [[foo ]]; then echo lol; fi
|
1
badcase/semicolonthen
Normal file
1
badcase/semicolonthen
Normal file
@@ -0,0 +1 @@
|
||||
if [[ foo ]]; then; echo lol; fi
|
1
badcase/spaceassign1
Normal file
1
badcase/spaceassign1
Normal file
@@ -0,0 +1 @@
|
||||
LOL = 3
|
1
badcase/spaceassign2
Normal file
1
badcase/spaceassign2
Normal file
@@ -0,0 +1 @@
|
||||
LOL= 3
|
1
badcase/spaceassign3
Normal file
1
badcase/spaceassign3
Normal file
@@ -0,0 +1 @@
|
||||
LOL =3
|
2
badcase/subshellvar
Normal file
2
badcase/subshellvar
Normal file
@@ -0,0 +1,2 @@
|
||||
echo cow | while read foo; do DIR=$foo; done
|
||||
echo $DIR
|
2
badcase/unexpanded
Normal file
2
badcase/unexpanded
Normal file
@@ -0,0 +1,2 @@
|
||||
foo=bar
|
||||
echo $file | sed -e 's/$foo/baz/g'
|
1
badcase/unquotedtest
Normal file
1
badcase/unquotedtest
Normal file
@@ -0,0 +1 @@
|
||||
if [ -f $foo ]; then echo cow; fi
|
2
goodcase/double
Normal file
2
goodcase/double
Normal file
@@ -0,0 +1,2 @@
|
||||
echo hello
|
||||
echo world
|
1
goodcase/double2
Normal file
1
goodcase/double2
Normal file
@@ -0,0 +1 @@
|
||||
echo one; echo two
|
1
goodcase/forloop
Normal file
1
goodcase/forloop
Normal file
@@ -0,0 +1 @@
|
||||
for f in *; do echo "$f"; done
|
1
goodcase/if
Normal file
1
goodcase/if
Normal file
@@ -0,0 +1 @@
|
||||
if true; then echo foo; fi
|
4
goodcase/ifcommand
Normal file
4
goodcase/ifcommand
Normal file
@@ -0,0 +1,4 @@
|
||||
if file foo 2>&1 | grep lol 2> /dev/null
|
||||
then
|
||||
echo cow
|
||||
fi
|
1
goodcase/iftest
Normal file
1
goodcase/iftest
Normal file
@@ -0,0 +1 @@
|
||||
if [[ $B == 3 ]]; then echo cow; fi
|
1
goodcase/redir
Normal file
1
goodcase/redir
Normal file
@@ -0,0 +1 @@
|
||||
echo cow > file
|
1
goodcase/redir2
Normal file
1
goodcase/redir2
Normal file
@@ -0,0 +1 @@
|
||||
echo lol 2> /dev/null
|
1
goodcase/redir3
Normal file
1
goodcase/redir3
Normal file
@@ -0,0 +1 @@
|
||||
cmd > /dev/null 2>&1
|
1
goodcase/simple
Normal file
1
goodcase/simple
Normal file
@@ -0,0 +1 @@
|
||||
echo hello
|
Reference in New Issue
Block a user