mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Heuristic rules to distinguish .sc files between SuperCollider and Scala
This commit is contained in:
@@ -98,4 +98,16 @@ class TestHeuristcs < Test::Unit::TestCase
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def test_sc_supercollider_by_heuristics
|
||||
languages = ["Scala", "SuperCollider"]
|
||||
results = Heuristics.disambiguate_sc(fixture("SuperCollider/WarpPreset.sc"), languages)
|
||||
assert_equal Language["SuperCollider"], results.first
|
||||
end
|
||||
|
||||
def test_sc_scala_by_heuristics
|
||||
languages = ["Scala", "SuperCollider"]
|
||||
results = Heuristics.disambiguate_sc(fixture("Scala/node11.sc"), languages)
|
||||
assert_equal Language["Scala"], results.first
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user