Fix heuristics after rename (#3556)

* fix Roff detection in heuristics

This affects extensions .l, .ms, .n and .rno.

Groff was renamed to Roff in 673aeb32b9851cc58429c4b598c876292aaf70c7,
but heuristic was not updated.

* replace FORTRAN with Fortran

It was already renamed in most places since 4fd8fce08574809aa58e9771e2a9da5d135127be
heuristics.rb was missing though.

* fix caseness of GCC Machine Description
This commit is contained in:
Santiago M. Mola
2017-04-27 00:31:36 +02:00
committed by Colin Seymour
parent eb38c8dcf8
commit c0e242358a
2 changed files with 33 additions and 9 deletions

View File

@@ -106,7 +106,7 @@ class TestHeuristcs < Minitest::Test
def test_f_by_heuristics
assert_heuristics({
"FORTRAN" => all_fixtures("FORTRAN", "*.f") + all_fixtures("FORTRAN", "*.for"),
"Fortran" => all_fixtures("Fortran", "*.f") + all_fixtures("Fortran", "*.for"),
"Forth" => all_fixtures("Forth", "*.f") + all_fixtures("Forth", "*.for")
})
end
@@ -144,6 +144,15 @@ class TestHeuristcs < Minitest::Test
})
end
def test_l_by_heuristics
assert_heuristics({
"Common Lisp" => all_fixtures("Common Lisp", "*.l"),
"Lex" => all_fixtures("Lex", "*.l"),
"Roff" => all_fixtures("Roff", "*.l"),
"PicoLisp" => all_fixtures("PicoLisp", "*.l")
})
end
def test_ls_by_heuristics
assert_heuristics({
"LiveScript" => all_fixtures("LiveScript", "*.ls"),
@@ -174,17 +183,25 @@ class TestHeuristcs < Minitest::Test
def test_md_by_heuristics
assert_heuristics({
"Markdown" => all_fixtures("Markdown", "*.md"),
"GCC machine description" => all_fixtures("GCC machine description", "*.md")
"GCC Machine Description" => all_fixtures("GCC Machine Description", "*.md")
})
end
def test_ms_by_heuristics
assert_heuristics({
"Roff" => all_fixtures("Roff", "*.ms"),
"Unix Assembly" => all_fixtures("Unix Assembly", "*.ms"),
"MAXScript" => all_fixtures("MAXScript", "*.ms")
})
end
def test_n_by_heuristics
assert_heuristics({
"Roff" => all_fixtures("Roff", "*.n"),
"Nemerle" => all_fixtures("Nemerle", "*.n")
})
end
# Candidate languages = ["C++", "Objective-C"]
def test_obj_c_by_heuristics
# Only calling out '.h' filenames as these are the ones causing issues
@@ -237,6 +254,13 @@ class TestHeuristcs < Minitest::Test
})
end
def test_rno_by_heuristics
assert_heuristics({
"RUNOFF" => all_fixtures("RUNOFF", "*.rno"),
"Roff" => all_fixtures("Roff", "*.rno")
})
end
# Candidate languages = ["Scala", "SuperCollider"]
def test_sc_supercollider_scala_by_heuristics
assert_heuristics({