Narrow test and set ACTIVE flag for heuristics

This commit is contained in:
Ted Nyman
2013-12-22 15:25:56 -08:00
parent 51195290b8
commit c8761d39d7
2 changed files with 12 additions and 4 deletions

View File

@@ -14,7 +14,7 @@ class TestHeuristcs < Test::Unit::TestCase
def fixture(name)
File.read(File.join(samples_path, name))
end
# Only calling out '.h' filenames as these are the ones causing issues
def all_h_fixtures(language_name)
Dir.glob("#{samples_path}/#{language_name}/*.h")
@@ -23,7 +23,7 @@ class TestHeuristcs < Test::Unit::TestCase
def test_obj_c_by_heuristics
languages = ["C++", "Objective-C"]
all_h_fixtures("Objective-C").each do |fixture|
results = Heuristics.find_by_heuristics(fixture("Objective-C/#{File.basename(fixture)}"), languages)
results = Heuristics.disambiguate_h(fixture("Objective-C/#{File.basename(fixture)}"), languages)
assert_equal Language["Objective-C"], results.first
end
end