From b065d5e6afb0f61d1f33ffbcb8bb54c324553985 Mon Sep 17 00:00:00 2001 From: nirvn Date: Thu, 1 Apr 2021 16:30:34 +0700 Subject: [PATCH] Update to a more logical regular expression test string --- tests/src/python/test_qgsdelimitedtextprovider.py | 2 +- .../python/test_qgsdelimitedtextprovider_wanted.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/src/python/test_qgsdelimitedtextprovider.py b/tests/src/python/test_qgsdelimitedtextprovider.py index 68f1e5f638e7..68a5dd138c1f 100644 --- a/tests/src/python/test_qgsdelimitedtextprovider.py +++ b/tests/src/python/test_qgsdelimitedtextprovider.py @@ -574,7 +574,7 @@ def test_017_regular_expression_1(self): def test_018_regular_expression_2(self): # Parsing regular expression delimiter with capture groups filename = 'testre.txt' - params = {'geomType': 'none', 'trimFields': 'Y', 'delimiter': '(RE)(GEXP)?', 'type': 'regexp'} + params = {'geomType': 'none', 'trimFields': 'Y', 'delimiter': '(RE)((?:GEXP)?)', 'type': 'regexp'} requests = None self.runTest(filename, requests, **params) diff --git a/tests/src/python/test_qgsdelimitedtextprovider_wanted.py b/tests/src/python/test_qgsdelimitedtextprovider_wanted.py index 96fa1073a22e..25c59e86fe51 100644 --- a/tests/src/python/test_qgsdelimitedtextprovider_wanted.py +++ b/tests/src/python/test_qgsdelimitedtextprovider_wanted.py @@ -869,7 +869,7 @@ def test_017_regular_expression_1(): def test_018_regular_expression_2(): wanted = {} - wanted['uri'] = 'file://testre.txt?geomType=none&trimFields=Y&delimiter=(RE)(GEXP)?&type=regexp' + wanted['uri'] = 'file://testre.txt?geomType=none&trimFields=Y&delimiter=(RE)((?:GEXP)?)&type=regexp' wanted['fieldTypes'] = ['integer', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text', 'text'] wanted['geometryType'] = 4 wanted['data'] = { @@ -893,11 +893,11 @@ def test_018_regular_expression_2(): 'GEXP': 'GEXP', 'description': 'RE', 'RE_1': 'RE', - 'GEXP_1': 'data2', - 'data': 'RE', - 'RE_2': 'info2', - 'GEXP_2': 'NULL', - 'info': 'NULL', + 'GEXP_1': '', + 'data': 'data2', + 'RE_2': 'RE', + 'GEXP_2': '', + 'info': 'info2', '#fid': 3, '#geometry': 'None', },