mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Merge branch 'master' into cpp_heuristic
Conflicts: lib/linguist/samples.json
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user