mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-24 11:57:59 +01:00
Add test for RegexSet
This commit is contained in:
parent
34f7f7123f
commit
78aefe154a
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