mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Merge remote-tracking branch 'origin/master' into test-helper
* origin/master: Add Gemfile.lock sample Remove deprecated method #all_extensions already includes primary extension typo remove unused assertion Symlink ant.xml to build.xml Avoid shadowing variable name Update comment Make missing sample failure message similar Remove blank extensions property Fix sample tests Add Forth extensions .f and .for; add heuristics for Forth and FORTRAN. Add FORTRAN and Forth samples. Extensions aren't actually required Fix errors from pedantic test Make pedantic test actually pedantic Removing extensions when they should be filenames Adding sample pom.xml files Link to contributing docs require samples if filename matches multiple languages Conflicts: test/test_pedantic.rb
This commit is contained in:
@@ -100,6 +100,16 @@ class TestHeuristcs < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
|
||||
def test_f_by_heuristics
|
||||
languages = ["FORTRAN", "Forth"]
|
||||
languages.each do |language|
|
||||
all_fixtures(language).each do |fixture|
|
||||
results = Heuristics.disambiguate_f(fixture("#{language}/#{File.basename(fixture)}"))
|
||||
assert_equal Language[language], results.first
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# Candidate languages = ["Hack", "PHP"]
|
||||
def test_hack_by_heuristics
|
||||
results = Heuristics.disambiguate_hack(fixture("Hack/funs.php"))
|
||||
|
||||
Reference in New Issue
Block a user