Attempted bats @test support

This commit is contained in:
Vidar Holen 2016-05-22 18:53:35 -07:00
parent 47fd16b8e8
commit ad1a0da954
5 changed files with 37 additions and 1 deletions

View file

@ -1934,6 +1934,16 @@ readBraceGroup = called "brace group" $ do
fail "Missing '}'"
return $ T_BraceGroup id list
prop_readBatsTest = isOk readBatsTest "@test 'can parse' {\n true\n}"
readBatsTest = called "bats @test" $ do
id <- getNextId
try $ string "@test"
spacing
name <- readNormalWord
spacing
test <- readBraceGroup
return $ T_BatsTest id name test
prop_readWhileClause = isOk readWhileClause "while [[ -e foo ]]; do sleep 1; done"
readWhileClause = called "while loop" $ do
pos <- getPosition
@ -2186,6 +2196,7 @@ readCompoundCommand = do
readForClause,
readSelectClause,
readCaseClause,
readBatsTest,
readFunctionDefinition
]
spacing
@ -2534,6 +2545,7 @@ readScript = do
"ash",
"dash",
"bash",
"bats",
"ksh"
]
badShells = [