1 require File.dirname(__FILE__) + '/../test_helper'
3 class Ohcount::BooTest < Ohcount::Test
5 lb = [Ohcount::LanguageBreakdown.new("boo", "", "#comment", 0)]
6 assert_equal lb, Ohcount::parse(" #comment", "boo")
10 lb = [Ohcount::LanguageBreakdown.new("boo", "", "/*comment*/", 0)]
11 assert_equal lb, Ohcount::parse(" /*comment*/", "boo")
14 def test_nested_block_comment
15 lb = [Ohcount::LanguageBreakdown.new("boo", "", "/* comment\n/* nested */\nstill a comment */", 0)]
16 assert_equal lb, Ohcount::parse(" /* comment\n /* nested */\n still a comment */", "boo")
20 lb = [Ohcount::LanguageBreakdown.new("boo", "", "\"\"\"\ndoc comment\n\"\"\"", 0)]
21 assert_equal lb, Ohcount::parse("\"\"\"\ndoc comment\n\"\"\"", "boo")
25 lb = [Ohcount::LanguageBreakdown.new("boo", "\"abc#not a 'comment\"", "", 0)]
26 assert_equal lb, Ohcount::parse("\"abc#not a 'comment\"", "boo")
29 def test_comprehensive
30 verify_parse("boo1.boo")
33 def test_comment_entities
34 assert_equal('#comment', entities_array(" #comment", 'boo', :comment).first)
35 assert_equal('//comment', entities_array(" //comment", 'boo', :comment).first)