Skip to content

Commit

Permalink
add detection for Dart
Browse files Browse the repository at this point in the history
  • Loading branch information
igrigorik committed Apr 9, 2012
1 parent a36e032 commit a3dc9fb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/linguist/languages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,13 @@ Darcs Patch:
- .darcspatch
- .dpatch

Dart:
type: programming
lexer: Dart
primary_extension: .dart
extensions:
- .dart

Delphi:
type: programming
primary_extension: .pas
Expand Down
4 changes: 4 additions & 0 deletions test/test_blob.rb
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ def test_language

# Julia: http://julialang.org/
assert_equal Language['Julia'], blob("stockcorr.jl").language

# Dart: http://dartlang.org/
assert_equal Language['Dart'], blob("point.dart").language
end

def test_lexer
Expand All @@ -442,6 +445,7 @@ def test_lexer
assert_equal Lexer['Tea'], blob("foo.tea").lexer
assert_equal Lexer['vhdl'], blob("foo.vhd").lexer
assert_equal Lexer['Julia'], blob("stockcorr.jl").lexer
assert_equal Lexer['Dart'], blob("point.dart").lexer
end

def test_shebang_script
Expand Down
2 changes: 2 additions & 0 deletions test/test_language.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def test_find_by_alias
assert_equal Language['Common Lisp'], Language.find_by_alias('common-lisp')
assert_equal Language['Common Lisp'], Language.find_by_alias('lisp')
assert_equal Language['Darcs Patch'], Language.find_by_alias('dpatch')
assert_equal Language['Dart'], Language.find_by_alias('dart')
assert_equal Language['Emacs Lisp'], Language.find_by_alias('elisp')
assert_equal Language['Emacs Lisp'], Language.find_by_alias('emacs')
assert_equal Language['Emacs Lisp'], Language.find_by_alias('emacs-lisp')
Expand Down Expand Up @@ -242,6 +243,7 @@ def test_find_all_by_alias
def test_find_by_extension
assert_equal Language['Ruby'], Language.find_by_extension('.rb')
assert_equal Language['Ruby'], Language.find_by_extension('rb')
assert_equal Language['Dart'], Language.find_by_extension('dart')
assert_equal Language['Groff'], Language.find_by_extension('man')
assert_equal Language['Groff'], Language.find_by_extension('1')
assert_equal Language['Groff'], Language.find_by_extension('2')
Expand Down

0 comments on commit a3dc9fb

Please sign in to comment.