提交 081751c1 编写于 作者: V Vidar Holen

Fixed case sensitivity in 'trap' bashism test

上级 cc86aab3
...@@ -639,6 +639,7 @@ prop_checkBashisms22= verifyNot checkBashisms "[ foo -a bar ]" ...@@ -639,6 +639,7 @@ prop_checkBashisms22= verifyNot checkBashisms "[ foo -a bar ]"
prop_checkBashisms23= verify checkBashisms "trap mything err int" prop_checkBashisms23= verify checkBashisms "trap mything err int"
prop_checkBashisms24= verifyNot checkBashisms "trap mything int term" prop_checkBashisms24= verifyNot checkBashisms "trap mything int term"
prop_checkBashisms25= verify checkBashisms "cat < /dev/tcp/host/123" prop_checkBashisms25= verify checkBashisms "cat < /dev/tcp/host/123"
prop_checkBashisms26= verify checkBashisms "trap mything ERR SIGTERM"
checkBashisms _ = bashism checkBashisms _ = bashism
where where
errMsg id s = err id 2040 $ "In sh, " ++ s ++ " not supported, even when sh is actually bash." errMsg id s = err id 2040 $ "In sh, " ++ s ++ " not supported, even when sh is actually bash."
...@@ -718,7 +719,7 @@ checkBashisms _ = bashism ...@@ -718,7 +719,7 @@ checkBashisms _ = bashism
when (name == "trap") $ when (name == "trap") $
let let
check token = potentially $ do check token = potentially $ do
word <- getLiteralString token word <- liftM (map toLower) $ getLiteralString token
guard $ word `elem` ["err", "debug", "return"] guard $ word `elem` ["err", "debug", "return"]
return $ warnMsg (getId token) $ "trapping " ++ word ++ " is" return $ warnMsg (getId token) $ "trapping " ++ word ++ " is"
in in
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册