From d766100c297bc094491de150f24c04719ffa8f4e Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Thu, 18 Jan 2018 23:23:56 -0500 Subject: Enhancement/speed up (#650) * Revert back to m.facebook * Add initial speedup * Update theme * Fix link press for event status * Move web states to fb const * Fix images and email * Fix up flyweight for requests * Ensure frost request is synchronous * Prepare diff utils * Improve speed and fix blank overlay * Update comments * Add debugger and fix searchview * Theme discover pages. Resolves #654 * Fix duplicate reload * Fix image loading * Update changelog * Update tests * Rename test Update dependencies Update gitignore --- .../kotlin/com/pitchedapps/frost/utils/UrlTests.kt | 26 ++++++++++++++-------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'app/src/test/kotlin/com/pitchedapps/frost/utils') diff --git a/app/src/test/kotlin/com/pitchedapps/frost/utils/UrlTests.kt b/app/src/test/kotlin/com/pitchedapps/frost/utils/UrlTests.kt index 5dbcad65..109387a0 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/utils/UrlTests.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/utils/UrlTests.kt @@ -2,6 +2,7 @@ package com.pitchedapps.frost.utils import com.pitchedapps.frost.facebook.FACEBOOK_COM import org.junit.Test +import kotlin.test.assertEquals import kotlin.test.assertFalse import kotlin.test.assertTrue @@ -14,15 +15,22 @@ class UrlTests { @Test fun independence() { - assertTrue(GOOGLE.isIndependent, "google") - assertTrue(FACEBOOK_COM.isIndependent, "facebook") - assertFalse("#!/photos/viewer/?photoset_token=pcb.1234".isIndependent, "photo") - assertFalse("#test-id".isIndependent, "id") - assertFalse("#".isIndependent, "#") - assertFalse("#!".isIndependent, "#!") - assertFalse("#!/".isIndependent, "#!/") - assertTrue("/this/is/valid".isIndependent, "url segments") - assertTrue("#!/facebook/segment".isIndependent, "facebook segments") + + mapOf( + GOOGLE to true, + FACEBOOK_COM to true, + "#!/photos/viewer/?photoset_token=pcb.1234" to false, + "#test-id" to false, + "#" to false, + "#!" to false, + "#!/" to false, + "#!/events/permalink/going/?event_id=" to false, + "/this/is/valid" to true, + "#!/facebook/segment" to true + ).forEach { (url, valid) -> + assertEquals(valid, url.isIndependent, + "Independence test failed for $url; should be $valid") + } } @Test -- cgit v1.2.3