summaryrefslogtreecommitdiff
path: root/yarnlib
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-06-09 12:07:44 +0100
committerLars Wirzenius <liw@liw.fi>2013-06-09 12:07:44 +0100
commita6c8b66d4c8bc4138dae2a8872b8fa879d1eb2f1 (patch)
tree1238151cce58c5692e84d98916a3ff0d4f6eb360 /yarnlib
parentd5b13256d9db7f94420a0b052055f691a3ede56f (diff)
downloadcmdtest-a6c8b66d4c8bc4138dae2a8872b8fa879d1eb2f1.tar.gz
Add tests for misplaced ANDs
Diffstat (limited to 'yarnlib')
-rw-r--r--yarnlib/block_parser_tests.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/yarnlib/block_parser_tests.py b/yarnlib/block_parser_tests.py
index b28e258..0a1d441 100644
--- a/yarnlib/block_parser_tests.py
+++ b/yarnlib/block_parser_tests.py
@@ -72,6 +72,18 @@ class BlockParserTests(unittest.TestCase):
self.parser.parse_blocks,
['GIVEN foo'])
+ def test_raises_error_for_AND_before_story(self):
+ self.assertRaises(
+ yarnlib.BlockError,
+ self.parser.parse_blocks,
+ ['AND bar'])
+
+ def test_raises_error_for_AND_before_step(self):
+ self.assertRaises(
+ yarnlib.BlockError,
+ self.parser.parse_blocks,
+ ['STORY foo\nAND bar'])
+
def test_parses_implements_in_a_block_by_itself(self):
self.parser.parse_blocks(['IMPLEMENTS GIVEN foo\ntrue'])
impls = self.parser.implementations