Change RegexMatch from ref to Option

Also associated changes to tests and code
This commit is contained in:
Flaviu Tamas 2015-01-28 20:33:33 -05:00
commit a1110ebb14
5 changed files with 20 additions and 23 deletions

View file

@ -1,4 +1,4 @@
import unittest
import unittest, optional_t.nonstrict
include nre
suite "captures":

View file

@ -1,4 +1,4 @@
import unittest, sequtils, nre
import unittest, sequtils, nre, optional_t.nonstrict
suite "find":
test "find text":

View file

@ -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")

View file

@ -1,4 +1,4 @@
import unittest, nre
import unittest, nre, optional_t.nonstrict
suite "Misc tests":
test "unicode":