mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-05 03:55:58 +01:00
Add test for RegexSet
This commit is contained in:
parent
7a777ab914
commit
ac5919bcf7
1 changed files with 25 additions and 0 deletions
|
@ -0,0 +1,25 @@
|
|||
package org.pgpainless.wot.dijkstra.sq
|
||||
|
||||
import kotlin.test.Test
|
||||
|
||||
class RegexSetTest {
|
||||
|
||||
@Test
|
||||
fun simpleMatch() {
|
||||
val stringList: List<String> = listOf("<[^>]+[@.]foobank\\.com>$")
|
||||
val rs = RegexSet.fromExpressionList(stringList);
|
||||
|
||||
assert(rs.matches("Foo Bank Employee <employee@foobank.com>"))
|
||||
assert(rs.matches("<employee@foobank.com>"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun simpleNonMatch() {
|
||||
val stringList: List<String> = listOf("<[^>]+[@.]foobank\\.com>$")
|
||||
val rs = RegexSet.fromExpressionList(stringList);
|
||||
|
||||
assert(!rs.matches("Bar Bank Employee <employee@barbank.com>"))
|
||||
assert(!rs.matches("<employee@barbank.com>"))
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in a new issue