• R/O
  • SSH

Commit

Tags
Keine Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Castle: The best Real-Time/Embedded/HighTech language EVER. Attempt 2


Commit MetaInfo

Revisione301e7991ae146cfa49c1c6fa5b02e775b7d22c5 (tree)
Zeit2021-12-21 05:51:08
AutorAlbert Mietus < albert AT mietus DOT nl >
CommiterAlbert Mietus < albert AT mietus DOT nl >

Log Message

refactored string-test

Ändern Zusammenfassung

Diff

diff -r 4c63a33e26c2 -r e301e7991ae1 Arpeggio/pytst/d2_ast/test_1_term.py
--- a/Arpeggio/pytst/d2_ast/test_1_term.py Sun Dec 19 22:21:15 2021 +0100
+++ b/Arpeggio/pytst/d2_ast/test_1_term.py Mon Dec 20 21:51:08 2021 +0100
@@ -11,8 +11,9 @@
1111 def parse(txt, rule):
1212 parser = arpeggio.ParserPython(rule)
1313 pt = parser.parse(txt)
14- assert pt.position_end == len(txt), "Did not parse all input"# JTBS
14+ assert pt.position_end == len(txt), "Did not parse all input" # JTBS
1515 ast = arpeggio.visit_parse_tree(pt, visitor.PegVisitor())
16+ assert ast.position == 0 and ast.position_end == len(txt), "Also the AST should include all input"
1617 return ast
1718
1819 def test_simple_str():
@@ -21,14 +22,10 @@
2122 assert isinstance(ast, peg.Terminal), "It should be a term ..."
2223 assert isinstance(ast, peg.StrTerm), "... and a str"
2324 assert ast.value == "a string", "It's correct value should be without quotes"
24- assert ast.position == 0, "The term's position includes the quotes ..."
25- assert ast.position_end == len(txt), " ... on both ends."
2625
27-def test_simple_str_2():
28- txt='"""triple string"""'
26+def test_simple_str_d3():
27+ txt='"""triple string"""' # A triple double quotes in Castle is also a simple string
2928 ast = parse(txt, grammar.term)
3029 assert isinstance(ast, peg.Terminal), "It should be a term ..."
3130 assert isinstance(ast, peg.StrTerm), "... and a str"
3231 assert ast.value == "triple string", "It's correct value should be without quotes"
33- assert ast.position == 0, "The term's position includes the quotes ..."
34- assert ast.position_end == len(txt), " ... on both ends."