diff options
author | Allan Wang <me@allanwang.ca> | 2017-12-26 03:37:32 -0500 |
---|---|---|
committer | Allan Wang <me@allanwang.ca> | 2017-12-26 03:39:28 -0500 |
commit | 1769dbcef9786b847ffeaebdf6ecced45da9222c (patch) | |
tree | 50f543469607b608c0b62ca8a63c6a65325802b9 /app/src/test/kotlin/com/pitchedapps/frost/parsers | |
parent | 8080d43dbd9a6863fadb86594b179d0919d6215b (diff) | |
download | frost-1769dbcef9786b847ffeaebdf6ecced45da9222c.tar.gz frost-1769dbcef9786b847ffeaebdf6ecced45da9222c.tar.bz2 frost-1769dbcef9786b847ffeaebdf6ecced45da9222c.zip |
Enhancement/fb requests (#575)v1.7.2
* Update lambdas to references
* Simplify regex and parsers
* Fix some parsing and add more tests
* Improve message parser and tests
* Simplify parser
* Shorten interfaces
* Push rem
* Create notification parser
* Clean up notification service
* Clean up notification service
* Add safe cookie fallback
* Fix cookie reference
* Make parsers only hold cookie string
* Clean up cookie references
* Fix up login and event theme
* Update changelog
Remove workspace backup
Diffstat (limited to 'app/src/test/kotlin/com/pitchedapps/frost/parsers')
-rw-r--r-- | app/src/test/kotlin/com/pitchedapps/frost/parsers/MessageParserTest.kt | 4 | ||||
-rw-r--r-- | app/src/test/kotlin/com/pitchedapps/frost/parsers/ParserTestHelper.kt | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/src/test/kotlin/com/pitchedapps/frost/parsers/MessageParserTest.kt b/app/src/test/kotlin/com/pitchedapps/frost/parsers/MessageParserTest.kt index 61c69c40..ecebed04 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/parsers/MessageParserTest.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/parsers/MessageParserTest.kt @@ -1,6 +1,8 @@ package com.pitchedapps.frost.parsers +import com.pitchedapps.frost.facebook.FB_EPOCH_MATCHER import com.pitchedapps.frost.facebook.formattedFbUrl +import com.pitchedapps.frost.facebook.get import org.junit.Test import kotlin.test.assertEquals @@ -15,7 +17,7 @@ class MessageParserTest { @Test fun parseEpoch() { val input = "{\"time\":1507301642,\"short\":true,\"forceseconds\":false}" - assertEquals(1507301642, FrostRegex.epoch.find(input)!!.groupValues[1].toLong()) + assertEquals(1507301642, FB_EPOCH_MATCHER.find(input)[1]!!.toLong()) } @Test diff --git a/app/src/test/kotlin/com/pitchedapps/frost/parsers/ParserTestHelper.kt b/app/src/test/kotlin/com/pitchedapps/frost/parsers/ParserTestHelper.kt index be5ac624..53495ecb 100644 --- a/app/src/test/kotlin/com/pitchedapps/frost/parsers/ParserTestHelper.kt +++ b/app/src/test/kotlin/com/pitchedapps/frost/parsers/ParserTestHelper.kt @@ -18,5 +18,5 @@ fun <T : Any> T.getResource(path: String): String? { fun <T : Any, P : Any> T.debug(path: String, parser: FrostParser<P>) { val content = getResource("priv/$path.html") ?: return - println(parser.debug(content)) +// println(parser.debug(content)) }
\ No newline at end of file |