mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-08-29 17:57:30 +00:00
fix getLanguage when arguments are null
This commit is contained in:
@@ -18,6 +18,17 @@ public class EnryTest {
|
||||
assertEquals("PHP", Enry.getLanguage("foobar.php", code.getBytes()));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getLanguageWithNullContent() {
|
||||
assertEquals("Python", Enry.getLanguage("foo.py", null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getLanguageWithNullFilename() {
|
||||
byte[] content = "#!/usr/bin/env python".getBytes();
|
||||
assertEquals("Python", Enry.getLanguage(null, content));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getLanguageByContent() {
|
||||
String code = "<?php $foo = bar();";
|
||||
|
Reference in New Issue
Block a user