Skip to content

Commit 3d99ccd

Browse files
tools/content: Add a flag to control verbosity of KaTeX check result
1 parent 801d726 commit 3d99ccd

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

tools/content/check-features

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ run_check() {
106106
run_katex_check() {
107107
flutter test tools/content/unimplemented_katex_test.dart \
108108
--dart-define=corpusDir="$opt_corpus_dir" \
109+
--dart-define=verbose="$opt_verbose" \
109110
|| return 1
110111
}
111112

tools/content/unimplemented_katex_test.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ void main() async {
113113
buf.writeln('Because of $reason:');
114114
buf.writeln(' ${messageIds.length} messages failed.');
115115
buf.writeln(' Oldest message: $oldestId, Newest message: $newestId');
116+
if (!_verbose) {
117+
buf.writeln();
118+
continue;
119+
}
120+
116121
buf.writeln(' Message IDs (up to 100): ${messageIds.take(100).join(', ')}');
117122
buf.writeln(' TeX source (up to 30):');
118123
for (final node in failedMathNodes.take(30)) {
@@ -153,6 +158,8 @@ void main() async {
153158

154159
const String _corpusDirPath = String.fromEnvironment('corpusDir');
155160

161+
const bool _verbose = int.fromEnvironment('verbose', defaultValue: 0) != 0;
162+
156163
Iterable<File> _getCorpusFiles() {
157164
final corpusDir = Directory(_corpusDirPath);
158165
return corpusDir.existsSync() ? corpusDir.listSync().whereType<File>() : [];

0 commit comments

Comments
 (0)