1 file changed, 25 insertions(+)
viff/test/sfdl/test_grammar.py |   25 +++++++++++++++++++++++++


# HG changeset patch
# User Martin Geisler <[EMAIL PROTECTED]>
# Date 1227518457 -3600
# Node ID 6afba4921987626a0211d1861aecccce808c7b02
# Parent  c2211d5ab86f58e451cb23f1a5b47068319b9d08
Test parsing of comments.

diff --git a/viff/test/sfdl/test_grammar.py b/viff/test/sfdl/test_grammar.py
--- a/viff/test/sfdl/test_grammar.py
+++ b/viff/test/sfdl/test_grammar.py
@@ -40,5 +40,30 @@
                          ['program', 'empty'])
         self.assertNoParse(self.grammar.program, "program {}")
 
+    def test_comment(self):
+        src = """
+                program empty {
+                   // a C-style comment
+                }
+              """
+        self.assertParse(self.grammar.program, src,
+                         ['program', 'empty'])
+
+        src = """
+                program empty {
+                   // a C++-style comment
+                }
+              """
+        self.assertParse(self.grammar.program, src,
+                         ['program', 'empty'])
+
+        src = """
+                program /* sneaky // comment */ empty {
+                   /****/ // /****/
+                }
+              """
+        self.assertParse(self.grammar.program, src,
+                         ['program', 'empty'])
+
 if SFDLGrammar is None:
     TestGrammar.skip = "Could not import SFDLGrammar, missing pyparsing?"
_______________________________________________
viff-patches mailing list
viff-patches@viff.dk
http://lists.viff.dk/listinfo.cgi/viff-patches-viff.dk

Reply via email to