From 389d5588d885955eff103b76049db9484ef69f7a Mon Sep 17 00:00:00 2001 From: Vidar Holen Date: Tue, 22 Jan 2013 14:50:30 -0800 Subject: [PATCH] Make [[ foo=bar ]] check say 'operator' instead of '=', because != --- ShellCheck/Analytics.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ShellCheck/Analytics.hs b/ShellCheck/Analytics.hs index b71fac8..a0cc29d 100644 --- a/ShellCheck/Analytics.hs +++ b/ShellCheck/Analytics.hs @@ -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}"