aboutsummaryrefslogtreecommitdiff
path: root/app/src/test/kotlin
diff options
context:
space:
mode:
authorAllan Wang <me@allanwang.ca>2020-05-23 17:53:50 -0700
committerAllan Wang <me@allanwang.ca>2020-05-23 17:53:50 -0700
commitaaca5878d5ac84b27917bbf1b7994fe59733fc97 (patch)
tree6c7d9e12b492153eee3a6afa9884dbc18613af5f /app/src/test/kotlin
parent000699d73c55cf6bfd5e03fc3f1b24daa21dd111 (diff)
downloadfrost-aaca5878d5ac84b27917bbf1b7994fe59733fc97.tar.gz
frost-aaca5878d5ac84b27917bbf1b7994fe59733fc97.tar.bz2
frost-aaca5878d5ac84b27917bbf1b7994fe59733fc97.zip
Query encode
Diffstat (limited to 'app/src/test/kotlin')
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt7
-rw-r--r--app/src/test/kotlin/com/pitchedapps/frost/utils/UrlTests.kt5
2 files changed, 12 insertions, 0 deletions
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt
index bdb74756..433fdb2a 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt
@@ -163,6 +163,13 @@ class FbUrlTest {
assertFbFormat(expected, url)
}
+ @Test
+ fun queryUrlEncode() {
+ val url = "${ FB_URL_BASE}sample/?q=#foo"
+ val expected = "${ FB_URL_BASE}sample/?q=%23foo"
+ assertFbFormat(expected, url)
+ }
+
// @Test
// fun viewFullImageIndirect() {
// val urlBase = "photo/view_full_size/?fbid=1234&ref_component=mbasic_photo_permalink&ref_page=%2Fwap%2Fphoto.php&refid=13&_ft_=qid.1234%3Amf_story_key.1234%3Atop_level_post_id"
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 85de8f89..ac6068ef 100644
--- a/app/src/test/kotlin/com/pitchedapps/frost/utils/UrlTests.kt
+++ b/app/src/test/kotlin/com/pitchedapps/frost/utils/UrlTests.kt
@@ -56,4 +56,9 @@ class UrlTests {
assertFalse(GOOGLE.isFacebookUrl, "google")
assertTrue(FACEBOOK_COM.isFacebookUrl, "facebook")
}
+
+ @Test
+ fun queryEncoding() {
+ assertEquals("%23foo", "#foo".urlEncode())
+ }
}