Change RegexMatch from ref to Option
Also associated changes to tests and code
This commit is contained in:
parent
43127455cb
commit
a1110ebb14
5 changed files with 20 additions and 23 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import unittest
|
||||
import unittest, optional_t.nonstrict
|
||||
include nre
|
||||
|
||||
suite "captures":
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import unittest, sequtils, nre
|
||||
import unittest, sequtils, nre, optional_t.nonstrict
|
||||
|
||||
suite "find":
|
||||
test "find text":
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
include nre, unittest
|
||||
include nre, unittest, optional_t.nonstrict
|
||||
|
||||
suite "match":
|
||||
test "upper bound must be exclusive":
|
||||
check("abc".match(re"abc", endpos = 0) == nil)
|
||||
check("abc".match(re"abc", endpos = 3) != nil)
|
||||
check("abc".match(re"abc", endpos = 0) == None[RegexMatch]())
|
||||
check("abc".match(re"abc", endpos = 3) != None[RegexMatch]())
|
||||
|
||||
test "match examples":
|
||||
check("abc".match(re"(\w)").captures[0] == "a")
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import unittest, nre
|
||||
import unittest, nre, optional_t.nonstrict
|
||||
|
||||
suite "Misc tests":
|
||||
test "unicode":
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue