1 require File.dirname(__FILE__) + '/../test_helper'
3 class CTest < LingoTest
6 lb = [Ohcount::LanguageBreakdown.new("dmd", "", "//comment", 0)]
7 assert_equal lb, Ohcount::parse(" //comment", "dmd")
10 def test_empty_comments
11 lb = [Ohcount::LanguageBreakdown.new("dmd", "","//\n", 0)]
12 assert_equal lb, Ohcount::parse(" //\n", "dmd")
16 lb = [Ohcount::LanguageBreakdown.new("dmd", "'/*' not a comment '*/'", "", 0)]
17 assert_equal lb, Ohcount::parse("'/*' not a comment '*/'", "dmd")
20 def test_block_comment
21 lb = [Ohcount::LanguageBreakdown.new("dmd", "","/*d*/", 0)]
22 assert_equal lb, Ohcount::parse("/*d*/", "dmd")
24 lb = [Ohcount::LanguageBreakdown.new("dmd", "","/+d+/", 0)]
25 assert_equal lb, Ohcount::parse("/+d+/", "dmd")
28 def test_nested_block_comment
29 lb = [Ohcount::LanguageBreakdown.new("dmd", "","/+ /*d*/ not_code(); +/", 0)]
30 assert_equal lb, Ohcount::parse("/+ /*d*/ not_code(); +/", "dmd")
33 def test_comprehensive