Skip emiting comment tokens

This commit is contained in:
Joshua Peek
2012-08-20 10:34:07 -05:00
parent 657adaabec
commit 220108857c
2 changed files with 17 additions and 14 deletions

View File

@@ -34,15 +34,15 @@ class TestTokenizer < Test::Unit::TestCase
end
def test_skip_comments
assert_equal %w(foo #), tokenize("foo\n# Comment")
assert_equal %w(foo # bar), tokenize("foo\n# Comment\nbar")
assert_equal %w(foo //), tokenize("foo\n// Comment")
assert_equal %w(foo /* */), tokenize("foo /* Comment */")
assert_equal %w(foo /* */), tokenize("foo /* \nComment\n */")
assert_equal %w(foo <!-- -->), tokenize("foo <!-- Comment -->")
assert_equal %w(foo {- -}), tokenize("foo {- Comment -}")
assert_equal %w(foo \(* *\)), tokenize("foo (* Comment *)")
assert_equal %w(% %), tokenize("2 % 10\n% Comment")
assert_equal %w(foo), tokenize("foo\n# Comment")
assert_equal %w(foo bar), tokenize("foo\n# Comment\nbar")
assert_equal %w(foo), tokenize("foo\n// Comment")
assert_equal %w(foo), tokenize("foo /* Comment */")
assert_equal %w(foo), tokenize("foo /* \nComment\n */")
assert_equal %w(foo), tokenize("foo <!-- Comment -->")
assert_equal %w(foo), tokenize("foo {- Comment -}")
assert_equal %w(foo), tokenize("foo (* Comment *)")
assert_equal %w(%), tokenize("2 % 10\n% Comment")
end
def test_sgml_tags