Skip to content

Commit

Permalink
add multi-line test
Browse files Browse the repository at this point in the history
  • Loading branch information
Net-Mist committed Apr 5, 2022
1 parent 7cddc59 commit 1e7a827
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions testing/testing_comment.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class TestComment(unittest.TestCase):
def validate(self, test_cases: list) -> None:
for test_case in test_cases:
output = cooklang.parseRecipe(test_case["input"])
print(output)
self.assertEqual(output["steps"][0][0]["value"], test_case["output_steps"])

def test_basic(self) -> None:
Expand All @@ -28,3 +29,15 @@ def test_close_twice(self) -> None:
]

self.validate(test_cases)

def test_multiline(self) -> None:
test_cases = [
{
"input": "meal for 4 people [- scale linearly \n for people \n but time does not scale-]",
"output_steps": "meal for 4 people ",
},
]
for test_case in test_cases:
output = cooklang.parseRecipe(test_case["input"])
print(output)
self.assertEqual(len(output["steps"]), 1)

0 comments on commit 1e7a827

Please sign in to comment.