Skip to content

Commit f9a79d8

Browse files
committed
content test [nfc]: Enable skips in testParseExample and testParse
1 parent 0e00af6 commit f9a79d8

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
@@ -2014,15 +2014,18 @@ UnimplementedInlineContentNode inlineUnimplemented(String html) {
20142014
return UnimplementedInlineContentNode(htmlNode: fragment.nodes.single);
20152015
}
20162016

2017-
void testParse(String name, String html, List<BlockContentNode> nodes) {
2017+
void testParse(String name, String html, List<BlockContentNode> nodes, {
2018+
Object? skip,
2019+
}) {
20182020
test(name, () {
20192021
check(parseContent(html))
20202022
.equalsNode(ZulipContent(nodes: nodes));
2021-
});
2023+
}, skip: skip);
20222024
}
20232025

2024-
void testParseExample(ContentExample example) {
2025-
testParse('parse ${example.description}', example.html, example.expectedNodes);
2026+
void testParseExample(ContentExample example, {Object? skip}) {
2027+
testParse('parse ${example.description}', example.html, example.expectedNodes,
2028+
skip: skip);
20262029
}
20272030

20282031
void main() async {
@@ -2411,7 +2414,7 @@ void main() async {
24112414
r'^\s*static\s+(?:const|final)\s+(\w+)\s*=\s*ContentExample\s*(?:\.\s*inline\s*)?\(',
24122415
).allMatches(source).map((m) => m.group(1));
24132416
final testedExamples = RegExp(multiLine: true,
2414-
r'^\s*testParseExample\s*\(\s*ContentExample\s*\.\s*(\w+)\);',
2417+
r'^\s*testParseExample\s*\(\s*ContentExample\s*\.\s*(\w+)(?:,\s*skip:\s*true)?\s*\);',
24152418
).allMatches(source).map((m) => m.group(1));
24162419
check(testedExamples).unorderedEquals(declaredExamples);
24172420
}, skip: Platform.isWindows, // [intended] purely analyzes source, so

0 commit comments

Comments
 (0)