Add test for empty file content

This commit is contained in:
Alexander Bezzubov 2017-09-22 17:39:02 +02:00
parent a6faaaf012
commit b020f78841
No known key found for this signature in database
GPG Key ID: 8039F5787EFCD05D

View File

@ -23,6 +23,11 @@ public class EnryTest {
assertEquals("Python", Enry.getLanguage("foo.py", null)); assertEquals("Python", Enry.getLanguage("foo.py", null));
} }
@Test
public void getLanguageWithEmptyContent() {
assertEquals("Go", Enry.getLanguage("baz.go", "".getBytes()));
}
@Test @Test
public void getLanguageWithNullFilename() { public void getLanguageWithNullFilename() {
byte[] content = "#!/usr/bin/env python".getBytes(); byte[] content = "#!/usr/bin/env python".getBytes();