-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
See ACINQ/phoenix#588.
- Loading branch information
Showing
4 changed files
with
30 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/commonTest/kotlin/fr/acinq/lightning/bin/payments/ParserTestsCommon.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package fr.acinq.lightning.bin.payments | ||
|
||
import kotlin.test.Test | ||
import kotlin.test.assertEquals | ||
|
||
class ParserTestsCommon { | ||
|
||
@Test | ||
fun `test address parsing`() { | ||
data class TestCase(val address: String, val user: String, val domain: String) | ||
|
||
val testcases = listOf( | ||
TestCase("[email protected]", "foo", "bar.com"), | ||
TestCase("₿[email protected]", "foo", "bar.com"), | ||
TestCase("₿₿[email protected]", "foo", "bar.com"), | ||
) | ||
|
||
testcases.forEach { testCase -> assertEquals(testCase.user to testCase.domain, Parser.parseEmailLikeAddress(testCase.address)) } | ||
} | ||
} |