From dfa5066de7044c39c394fe0828d03eb236c9f887 Mon Sep 17 00:00:00 2001 From: Martin Fietz Date: Mon, 11 Dec 2017 20:13:14 +0100 Subject: Return random filename if sanitized filename would be empty --- .../java/de/test/antennapod/util/FilenameGeneratorTest.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/src/androidTest') diff --git a/app/src/androidTest/java/de/test/antennapod/util/FilenameGeneratorTest.java b/app/src/androidTest/java/de/test/antennapod/util/FilenameGeneratorTest.java index 13e8b9582..cb2d012e0 100644 --- a/app/src/androidTest/java/de/test/antennapod/util/FilenameGeneratorTest.java +++ b/app/src/androidTest/java/de/test/antennapod/util/FilenameGeneratorTest.java @@ -5,6 +5,7 @@ import java.io.IOException; import de.danoeh.antennapod.core.util.FileNameGenerator; import android.test.AndroidTestCase; +import android.text.TextUtils; public class FilenameGeneratorTest extends AndroidTestCase { @@ -41,7 +42,12 @@ public class FilenameGeneratorTest extends AndroidTestCase { public void testFeedTitleContainsDash() { String result = FileNameGenerator.generateFileName("Left - Right"); - assertEquals("Left Right", result); + assertEquals("Left - Right", result); + } + + public void testInvalidInput() { + String result = FileNameGenerator.generateFileName("???"); + assertTrue(!TextUtils.isEmpty(result)); } /** -- cgit v1.2.3