Skip to content

Commit b42ed94

Browse files
tools/content: Add a flag to control verbosity of KaTeX check result
1 parent 1251d87 commit b42ed94

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
@@ -101,6 +101,7 @@ run_check() {
101101
run_katex_check() {
102102
flutter test tools/content/unimplemented_katex_test.dart \
103103
--dart-define=corpusDir="$opt_corpus_dir" \
104+
--dart-define=verbose="$opt_verbose" \
104105
|| return 1
105106
}
106107

tools/content/unimplemented_katex_test.dart

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

149154
const String _corpusDirPath = String.fromEnvironment('corpusDir');
150155

156+
const bool _verbose = int.fromEnvironment('verbose', defaultValue: 0) != 0;
157+
151158
Iterable<File> _getCorpusFiles() {
152159
final corpusDir = Directory(_corpusDirPath);
153160
return corpusDir.existsSync() ? corpusDir.listSync().whereType<File>() : [];

0 commit comments

Comments
 (0)