Skip to content

Commit 3a892e9

Browse files
authored
Make a text string more generic to pass head analyzer (#2796)
* Make the text string more generic to pass head analyzer * Break up a more complicated case
1 parent 6a25cd2 commit 3a892e9

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

test/mustachio/runtime_renderer_render_test.dart

+11-9
Original file line numberDiff line numberDiff line change
@@ -571,24 +571,26 @@ line 1, column 9 of ${fooTemplateFile.path}: Failed to resolve 's2' as a propert
571571
var barTemplateFile = getFile('/project/src/bar.mustache');
572572
expect(
573573
() async => await Template.parse(barTemplateFile),
574-
throwsA(const TypeMatcher<FileSystemException>().having(
575-
(e) => e.message,
576-
'message',
577-
contains('"${barTemplateFile.path}" does not exist.'))));
574+
throwsA(const TypeMatcher<FileSystemException>()
575+
.having((e) => e.message, 'message', contains('does not exist.'))));
578576
});
579577

580578
test('Template parser throws when it cannot read a partial', () async {
581579
var barTemplateFile = getFile('/project/src/bar.mustache')
582580
..writeAsStringSync('Text {{#foo}}{{>missing.mustache}}{{/foo}}');
583-
var missingTemplateFile = getFile('/project/src/missing.mustache');
584581
expect(
585582
() async => await Template.parse(barTemplateFile),
586-
throwsA(const TypeMatcher<MustachioResolutionError>()
587-
.having((e) => e.message, 'message', contains('''
588-
line 1, column 14 of ${barTemplateFile.path}: FileSystemException (File "${missingTemplateFile.path}" does not exist.) when reading partial:
583+
throwsA(const TypeMatcher<MustachioResolutionError>().having(
584+
(e) => e.message,
585+
'message',
586+
allOf(
587+
contains('''
588+
line 1, column 14 of ${barTemplateFile.path}: FileSystemException'''),
589+
contains('''does not exist.'''),
590+
contains('''when reading partial:
589591
590592
1 │ Text {{#foo}}{{>missing.mustache}}{{/foo}}
591593
│ ^^^^^^^^^^^^^^^^^^^^^
592-
'''))));
594+
''')))));
593595
});
594596
}

0 commit comments

Comments
 (0)