Skip to content

Commit 10d0b6b

Browse files
chalindevoncarew
authored andcommitted
adjust @example warning message (#1299)
Make “file missing” warning message more consistent with other warning messages, and add missing newline.
1 parent 1c911bc commit 10d0b6b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/src/model.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1752,7 +1752,7 @@ abstract class ModelElement implements Comparable, Nameable, Documentable {
17521752
} else {
17531753
// TODO: is this the proper way to handle warnings?
17541754
var filePath = this.element.source.fullName.substring(dirPath.length + 1);
1755-
final msg = 'Warning: ${filePath}: @example file not found, $fragmentFile';
1755+
final msg = '\nwarning: ${filePath}: @example file not found, ${fragmentFile.path}';
17561756
stderr.write(msg);
17571757
}
17581758
return replacement;

test/compare_output_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,8 +134,8 @@ void main() {
134134
}
135135

136136
if (!result.stderr
137-
.contains(new RegExp(r'Warning:.*file-does-not-exist\.js'))) {
138-
fail('Warning missing for nonexistent @example: \nstdout: ${result.stdout} \nstderr: ${result.stderr}');
137+
.contains(new RegExp(r'warning:.*file-does-not-exist\.js'))) {
138+
fail('Missing warning for nonexistent @example: \nstdout: ${result.stdout} \nstderr: ${result.stderr}');
139139
}
140140
});
141141

0 commit comments

Comments
 (0)