Added two new heuristics tests for the new C/C++/Obj-C heuristics

This commit is contained in:
DX-MON
2014-04-02 21:41:02 +01:00
parent 6524ac3588
commit af30a80702
5 changed files with 296 additions and 0 deletions

View File

@@ -32,6 +32,15 @@ class TestHeuristcs < Test::Unit::TestCase
languages = ["C++", "Objective-C"]
results = Heuristics.disambiguate_c(fixture("C++/render_adapter.cpp"), languages)
assert_equal Language["C++"], results.first
languages = ["C++", "Objective-C", "C"]
results = Heuristics.disambiguate_c(fixture("C++/ThreadedQueue.h"), languages)
assert_equal Language["C++"], results.first
end
def test_c_by_heuristics
languages = ["C++", "Objective-C", "C"]
results = Heuristics.disambiguate_c(fixture("C/ArrowLeft.h"), languages)
assert_equal nil, results.first
end
def test_detect_still_works_if_nothing_matches