Fix incorrect property check

This commit is contained in:
Flaviu Tamas
2015-01-20 18:23:54 -05:00
parent 7c24290eec
commit 256435e8e3
2 changed files with 3 additions and 1 deletions

View File

@@ -327,7 +327,7 @@ proc match*(str: string, pattern: Regex, start = 0, endpos = -1): RegexMatch =
iterator findIter*(str: string, pattern: Regex, start = 0, endpos = -1): RegexMatch =
# see pcredemo for explaination
let matchesCrLf = pattern.matchesCrLf()
let unicode = bool(getinfo[cint](pattern, pcre.INFO_OPTIONS) and pcre.UTF8)
let unicode = (getinfo[cint](pattern, pcre.INFO_OPTIONS) and pcre.UTF8) > 0
let endpos = if endpos == -1: str.len else: endpos
var offset = start

View File

@@ -3,3 +3,5 @@ import unittest, nre
suite "Misc tests":
test "unicode":
check("".find(re("", "8")).match == "")
check("перевірка".replace(re(r"\w", "uW"), "") == "")