diff options
author | Martin Fietz <martin.fietz@gmail.com> | 2017-12-11 20:13:14 +0100 |
---|---|---|
committer | Martin Fietz <martin.fietz@gmail.com> | 2017-12-11 20:13:14 +0100 |
commit | dfa5066de7044c39c394fe0828d03eb236c9f887 (patch) | |
tree | b622b4a088bb5477d533115c0b86cdccede72e52 /app/src/androidTest | |
parent | 90cc07c9bb7335e5b8a2e4035f11f111d0af76cc (diff) | |
download | AntennaPod-dfa5066de7044c39c394fe0828d03eb236c9f887.zip |
Return random filename if sanitized filename would be empty
Diffstat (limited to 'app/src/androidTest')
-rw-r--r-- | app/src/androidTest/java/de/test/antennapod/util/FilenameGeneratorTest.java | 8 |
1 files changed, 7 insertions, 1 deletions
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)); } /** |