mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Test for Hack heuristic
This commit is contained in:
@@ -40,25 +40,25 @@ class TestHeuristcs < Test::Unit::TestCase
|
||||
match = Language.detect(blob)
|
||||
assert_equal Language["Objective-C"], match
|
||||
end
|
||||
|
||||
|
||||
def test_pl_prolog_by_heuristics
|
||||
languages = ["Perl", "Prolog"]
|
||||
results = Heuristics.disambiguate_pl(fixture("Prolog/turing.pl"), languages)
|
||||
assert_equal Language["Prolog"], results.first
|
||||
end
|
||||
|
||||
|
||||
def test_pl_perl_by_heuristics
|
||||
languages = ["Perl", "Prolog"]
|
||||
results = Heuristics.disambiguate_pl(fixture("Perl/perl-test.t"), languages)
|
||||
assert_equal Language["Perl"], results.first
|
||||
end
|
||||
|
||||
|
||||
def test_ecl_prolog_by_heuristics
|
||||
languages = ["ECL", "Prolog"]
|
||||
results = Heuristics.disambiguate_ecl(fixture("Prolog/or-constraint.ecl"), languages)
|
||||
assert_equal Language["Prolog"], results.first
|
||||
end
|
||||
|
||||
|
||||
def test_ecl_ecl_by_heuristics
|
||||
languages = ["ECL", "Prolog"]
|
||||
results = Heuristics.disambiguate_ecl(fixture("ECL/sample.ecl"), languages)
|
||||
@@ -105,6 +105,12 @@ class TestHeuristcs < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_hack_by_heuristics
|
||||
languages = ["Hack", "PHP"]
|
||||
results = Heuristics.disambiguate_hack(fixture("Hack/funs.php"), languages)
|
||||
assert_equal Language["Hack"], results.first
|
||||
end
|
||||
|
||||
def test_sc_supercollider_by_heuristics
|
||||
languages = ["Scala", "SuperCollider"]
|
||||
results = Heuristics.disambiguate_sc(fixture("SuperCollider/WarpPreset.sc"), languages)
|
||||
|
||||
Reference in New Issue
Block a user