Skip to content

Commit 64dcce3

Browse files
committed
test: Improve regex in Swift feature usage verification script
* Account for variable number of spaces. * Match strings like '-enable-upcoming-feature\'. We want to complain about these because the script cannot get the job done when the option and argument are on different lines. The capture group will match '' in these cases.
1 parent 986f1d4 commit 64dcce3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test/Misc/verify-swift-feature-testing.test-sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ EXCEPTIONAL_FILES = [
2828
]
2929

3030
ENABLE_FEATURE_RE = re.compile(
31-
r"-enable-(?:experimental|upcoming)-feature (?:-Xfrontend )?([A-Za-z0-9]*)"
31+
r"-enable-(?:experimental|upcoming)-feature(?:\s+-Xfrontend)?\s*([A-Za-z0-9]*)"
3232
)
3333
FEATURE_LIT_MARKER_RE = re.compile(r"swift_feature_([A-Za-z0-9]*)")
3434

0 commit comments

Comments
 (0)