mirror of
https://github.com/ralsina/tartrazine.git
synced 2024-11-10 13:32:24 +00:00
Merge pull request #106 from bzz/test/empty-content
Add failing test for empty file content
This commit is contained in:
commit
3d63a636bb
@ -58,7 +58,7 @@ class GoUtils {
|
||||
static GoSlice.ByValue toGoByteSlice(byte[] bytes) {
|
||||
int length = 0;
|
||||
Pointer ptr = null;
|
||||
if (bytes != null) {
|
||||
if (bytes != null && bytes.length > 0) {
|
||||
length = bytes.length;
|
||||
ptr = ptrFromBytes(bytes);
|
||||
}
|
||||
|
@ -23,6 +23,12 @@ public class EnryTest {
|
||||
assertEquals("Python", Enry.getLanguage("foo.py", null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getLanguageWithEmptyContent() {
|
||||
assertEquals("Go", Enry.getLanguage("baz.go", "".getBytes()));
|
||||
assertEquals("Go", Enry.getLanguage("baz.go", null));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getLanguageWithNullFilename() {
|
||||
byte[] content = "#!/usr/bin/env python".getBytes();
|
||||
|
Loading…
Reference in New Issue
Block a user