Skip to content

Commit b065d5e

Browse files
nirvnnyalldawson
authored andcommittedApr 1, 2021
Update to a more logical regular expression test string
1 parent be1ba89 commit b065d5e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed
 

‎tests/src/python/test_qgsdelimitedtextprovider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,7 @@ def test_017_regular_expression_1(self):
574574
def test_018_regular_expression_2(self):
575575
# Parsing regular expression delimiter with capture groups
576576
filename = 'testre.txt'
577-
params = {'geomType': 'none', 'trimFields': 'Y', 'delimiter': '(RE)(GEXP)?', 'type': 'regexp'}
577+
params = {'geomType': 'none', 'trimFields': 'Y', 'delimiter': '(RE)((?:GEXP)?)', 'type': 'regexp'}
578578
requests = None
579579
self.runTest(filename, requests, **params)
580580

‎tests/src/python/test_qgsdelimitedtextprovider_wanted.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ def test_017_regular_expression_1():
869869

870870
def test_018_regular_expression_2():
871871
wanted = {}
872-
wanted['uri'] = 'file://testre.txt?geomType=none&trimFields=Y&delimiter=(RE)(GEXP)?&type=regexp'
872+
wanted['uri'] = 'file://testre.txt?geomType=none&trimFields=Y&delimiter=(RE)((?:GEXP)?)&type=regexp'
873873
wanted['fieldTypes'] = ['integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text']
874874
wanted['geometryType'] = 4
875875
wanted['data'] = {
@@ -893,11 +893,11 @@ def test_018_regular_expression_2():
893893
'GEXP': 'GEXP',
894894
'description': 'RE',
895895
'RE_1': 'RE',
896-
'GEXP_1': 'data2',
897-
'data': 'RE',
898-
'RE_2': 'info2',
899-
'GEXP_2': 'NULL',
900-
'info': 'NULL',
896+
'GEXP_1': '',
897+
'data': 'data2',
898+
'RE_2': 'RE',
899+
'GEXP_2': '',
900+
'info': 'info2',
901901
'#fid': 3,
902902
'#geometry': 'None',
903903
},

0 commit comments

Comments
 (0)
Please sign in to comment.