mirror of
https://github.com/KevinMidboe/linguist.git
synced 2026-01-09 02:45:33 +00:00
Expanding TestHeuristcs to include all Objective C header files
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -14,11 +14,18 @@ class TestHeuristcs < Test::Unit::TestCase
|
|||||||
def fixture(name)
|
def fixture(name)
|
||||||
File.read(File.join(samples_path, name))
|
File.read(File.join(samples_path, name))
|
||||||
end
|
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")
|
||||||
|
end
|
||||||
|
|
||||||
def test_find_by_heuristics
|
def test_obj_c_by_heuristics
|
||||||
languages = ["C++", "Objective-C"]
|
languages = ["C++", "Objective-C"]
|
||||||
results = Heuristics.find_by_heuristics(fixture("Objective-C/StyleViewController.h"), languages)
|
all_h_fixtures("Objective-C").each do |fixture|
|
||||||
assert_equal Language["Objective-C"], results.first
|
results = Heuristics.find_by_heuristics(fixture("Objective-C/#{File.basename(fixture)}"), languages)
|
||||||
|
assert_equal Language["Objective-C"], results.first
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_detect_still_works_if_nothing_matches
|
def test_detect_still_works_if_nothing_matches
|
||||||
|
|||||||
Reference in New Issue
Block a user