예제 #1
0
 def test_not_allowed_multiline(self) -> None:
     val = "note: 'line1\nline2\nline3'"
     with self.assertRaises(ParseSyntaxException):
         note.parseString(val, parseAll=True)
예제 #2
0
 def test_unclosed_quote(self) -> None:
     val = 'note: "test note'
     with self.assertRaises(ParseSyntaxException):
         note.parseString(val, parseAll=True)
예제 #3
0
 def test_double_quote(self) -> None:
     val = 'note: \n "test note"'
     res = note.parseString(val, parseAll=True)
     self.assertEqual(res[0].text, 'test note')
예제 #4
0
 def test_multiline(self) -> None:
     val = "note: '''line1\nline2\nline3'''"
     res = note.parseString(val, parseAll=True)
     self.assertEqual(res[0].text, 'line1\nline2\nline3')
예제 #5
0
 def test_single_quote(self) -> None:
     val = "note: 'test note'"
     res = note.parseString(val, parseAll=True)
     self.assertEqual(res[0].text, 'test note')