diff options
Diffstat (limited to 'app/src/test')
-rw-r--r-- | app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt | 22 |
1 files changed, 18 insertions, 4 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 ca842ed9..5e1082d7 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/facebook/FbUrlTest.kt @@ -31,7 +31,11 @@ class FbUrlTest { @Suppress("NOTHING_TO_INLINE") inline fun assertFbFormat(expected: String, url: String) { val fbUrl = FbUrlFormatter(url) - assertEquals(expected, fbUrl.toString(), "FbUrl Mismatch:\n${fbUrl.toLogList().joinToString("\n\t")}") + assertEquals( + expected, + fbUrl.toString(), + "FbUrl Mismatch:\n${fbUrl.toLogList().joinToString("\n\t")}" + ) } @Test @@ -65,8 +69,10 @@ class FbUrlTest { @Test fun ampersand() { - val url = "https://scontent-yyz1-1.xx.fbcdn.net/v/t31.0-8/fr/cp0/e15/q65/123.jpg?_nc_cat=0&efg=asdf" - val formattedUrl = "https://scontent-yyz1-1.xx.fbcdn.net/v/t31.0-8/fr/cp0/e15/q65/123.jpg?_nc_cat=0&efg=asdf" + val url = + "https://scontent-yyz1-1.xx.fbcdn.net/v/t31.0-8/fr/cp0/e15/q65/123.jpg?_nc_cat=0&efg=asdf" + val formattedUrl = + "https://scontent-yyz1-1.xx.fbcdn.net/v/t31.0-8/fr/cp0/e15/q65/123.jpg?_nc_cat=0&efg=asdf" assertFbFormat(formattedUrl, url) } @@ -138,10 +144,18 @@ class FbUrlTest { @Test fun viewFullImage() { - val url = "https://scontent-yyz1-1.xx.fbcdn.net/v/t1.0-9/fr/cp0/e15/q65/asdf_n.jpg?efg=asdf&oh=asdf&oe=asdf" + val url = + "https://scontent-yyz1-1.xx.fbcdn.net/v/t1.0-9/fr/cp0/e15/q65/asdf_n.jpg?efg=asdf&oh=asdf&oe=asdf" assertFbFormat(url, "#!$url") } + @Test + fun queryFt() { + val url = "${FB_URL_BASE}sample/photos/a.12346/?source=48&_ft_=xxx" + val expected = "${FB_URL_BASE}sample/photos/a.12346/?source=48" + 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" |