From b020f78841aa4d494b4d562c79da5a9204495bca Mon Sep 17 00:00:00 2001 From: Alexander Bezzubov Date: Fri, 22 Sep 2017 17:39:02 +0200 Subject: [PATCH] Add test for empty file content --- java/src/test/java/tech/sourced/enry/EnryTest.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java/src/test/java/tech/sourced/enry/EnryTest.java b/java/src/test/java/tech/sourced/enry/EnryTest.java index 0b599c5..248a83d 100644 --- a/java/src/test/java/tech/sourced/enry/EnryTest.java +++ b/java/src/test/java/tech/sourced/enry/EnryTest.java @@ -23,6 +23,11 @@ public class EnryTest { assertEquals("Python", Enry.getLanguage("foo.py", null)); } + @Test + public void getLanguageWithEmptyContent() { + assertEquals("Go", Enry.getLanguage("baz.go", "".getBytes())); + } + @Test public void getLanguageWithNullFilename() { byte[] content = "#!/usr/bin/env python".getBytes();