Skip to content

Commit 4231608

Browse files
gnpricerajveermalviya
authored andcommitted
content test [nfc]: Enable skips in testParseExample and testParse
1 parent b42f784 commit 4231608

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

test/model/content_test.dart

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1642,15 +1642,18 @@ UnimplementedInlineContentNode inlineUnimplemented(String html) {
16421642
return UnimplementedInlineContentNode(htmlNode: fragment.nodes.single);
16431643
}
16441644

1645-
void testParse(String name, String html, List<BlockContentNode> nodes) {
1645+
void testParse(String name, String html, List<BlockContentNode> nodes, {
1646+
Object? skip,
1647+
}) {
16461648
test(name, () {
16471649
check(parseContent(html))
16481650
.equalsNode(ZulipContent(nodes: nodes));
1649-
});
1651+
}, skip: skip);
16501652
}
16511653

1652-
void testParseExample(ContentExample example) {
1653-
testParse('parse ${example.description}', example.html, example.expectedNodes);
1654+
void testParseExample(ContentExample example, {Object? skip}) {
1655+
testParse('parse ${example.description}', example.html, example.expectedNodes,
1656+
skip: skip);
16541657
}
16551658

16561659
void main() async {
@@ -2034,7 +2037,7 @@ void main() async {
20342037
r'^\s*static\s+(?:const|final)\s+(\w+)\s*=\s*ContentExample\s*(?:\.\s*inline\s*)?\(',
20352038
).allMatches(source).map((m) => m.group(1));
20362039
final testedExamples = RegExp(multiLine: true,
2037-
r'^\s*testParseExample\s*\(\s*ContentExample\s*\.\s*(\w+)\);',
2040+
r'^\s*testParseExample\s*\(\s*ContentExample\s*\.\s*(\w+)(?:,\s*skip:\s*true)?\s*\);',
20382041
).allMatches(source).map((m) => m.group(1));
20392042
check(testedExamples).unorderedEquals(declaredExamples);
20402043
}, skip: Platform.isWindows, // [intended] purely analyzes source, so

0 commit comments

Comments
 (0)