Make [[ foo=bar ]] check say 'operator' instead of '=', because !=

This commit is contained in:
Vidar Holen 2013-01-22 14:50:30 -08:00
parent 7c18ecee4f
commit 389d5588d8
1 changed files with 2 additions and 1 deletions

View File

@ -477,9 +477,10 @@ checkConstantIfs _ = return ()
prop_checkNoaryWasBinary = verify checkNoaryWasBinary "[[ a==$foo ]]"
prop_checkNoaryWasBinary2 = verify checkNoaryWasBinary "[ $foo=3 ]"
prop_checkNoaryWasBinary3 = verify checkNoaryWasBinary "[ foo!=3 ]"
checkNoaryWasBinary (TC_Noary _ _ t@(T_NormalWord id l)) = do
let str = concat $ deadSimple t
when ('=' `elem` str) $ err id $ "Always true because you didn't put spaces around the = ."
when ('=' `elem` str) $ err id $ "Always true because you didn't put spaces around the operator."
checkNoaryWasBinary _ = return ()
prop_checkBraceExpansionVars = verify checkBraceExpansionVars "echo {1..$n}"