Skip to content

Commit 7e71a67

Browse files
authored
+++
1 parent 0b37783 commit 7e71a67

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

testSrc/unit/io/flutter/CIIntegrityTest.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@ public void testGitHubWorkflowRegexSync() throws Exception {
6969

7070
String content = Files.readString(workflowFile.toPath());
7171

72-
// The workflow must use the exact same constant name in its grep/sed matching regex
72+
// The workflow must use the constant name followed by a flexible regex query in single or double quotes.
73+
// E.g., matches 'FLUTTER_VERSION="[0-9.]+"' or 'FLUTTER_VERSION="[0-9.]*"' or "FLUTTER_VERSION='[0-9.]+'"
74+
Pattern regexPattern = Pattern.compile("FLUTTER_VERSION=['\"].+?['\"]");
7375
assertTrue(
74-
"update_flutter.yaml must reference the 'FLUTTER_VERSION=\"[0-9.]+\"' constant in its search-and-replace step. " +
75-
"If you renamed this constant in tool/provision_flutter.sh, you must also update it inside update_flutter.yaml.",
76-
content.contains("FLUTTER_VERSION=\"[0-9.]+\"")
76+
"update_flutter.yaml must reference the 'FLUTTER_VERSION' constant with a regex pattern (e.g. 'FLUTTER_VERSION=\"[0-9.]+\"') " +
77+
"in its search-and-replace logic.",
78+
regexPattern.matcher(content).find()
7779
);
7880
}
7981
}

0 commit comments

Comments
 (0)