mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 20:38:47 +00:00
Enable testing absence of heuristic result
This commit is contained in:
@@ -29,10 +29,14 @@ class TestHeuristcs < Minitest::Test
|
||||
hash.each do |language, blobs|
|
||||
Array(blobs).each do |blob|
|
||||
result = Heuristics.call(file_blob(blob), candidates)
|
||||
if language.nil?
|
||||
assert_equal [], result, "Failed for #{blob}"
|
||||
else
|
||||
assert_equal [Language[language]], result, "Failed for #{blob}"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_detect_still_works_if_nothing_matches
|
||||
blob = Linguist::FileBlob.new(File.join(samples_path, "Objective-C/hello.m"))
|
||||
|
||||
Reference in New Issue
Block a user