mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Bring back missing test
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
require 'linguist/heuristics'
|
require 'linguist/heuristics'
|
||||||
require 'linguist/language'
|
require 'linguist/language'
|
||||||
require 'linguist/samples'
|
require 'linguist/samples'
|
||||||
|
require 'linguist/file_blob'
|
||||||
|
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
|
||||||
@@ -34,6 +35,12 @@ class TestHeuristcs < Test::Unit::TestCase
|
|||||||
assert_equal Language["C++"], results.first
|
assert_equal Language["C++"], results.first
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_detect_still_works_if_nothing_matches
|
||||||
|
blob = Linguist::FileBlob.new(File.join(samples_path, "Objective-C/hello.m"))
|
||||||
|
match = Language.detect(blob)
|
||||||
|
assert_equal Language["Objective-C"], match
|
||||||
|
end
|
||||||
|
|
||||||
def test_pl_prolog_by_heuristics
|
def test_pl_prolog_by_heuristics
|
||||||
languages = ["Perl", "Prolog"]
|
languages = ["Perl", "Prolog"]
|
||||||
results = Heuristics.disambiguate_pl(fixture("Prolog/turing.pl"), languages)
|
results = Heuristics.disambiguate_pl(fixture("Prolog/turing.pl"), languages)
|
||||||
|
|||||||
Reference in New Issue
Block a user