Skip to content

Make a text string more generic to pass head analyzer #2796

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 20, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions test/mustachio/runtime_renderer_render_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -571,24 +571,26 @@ line 1, column 9 of ${fooTemplateFile.path}: Failed to resolve 's2' as a propert
var barTemplateFile = getFile('/project/src/bar.mustache');
expect(
() async => await Template.parse(barTemplateFile),
throwsA(const TypeMatcher<FileSystemException>().having(
(e) => e.message,
'message',
contains('"${barTemplateFile.path}" does not exist.'))));
throwsA(const TypeMatcher<FileSystemException>()
.having((e) => e.message, 'message', contains('does not exist.'))));
});

test('Template parser throws when it cannot read a partial', () async {
var barTemplateFile = getFile('/project/src/bar.mustache')
..writeAsStringSync('Text {{#foo}}{{>missing.mustache}}{{/foo}}');
var missingTemplateFile = getFile('/project/src/missing.mustache');
expect(
() async => await Template.parse(barTemplateFile),
throwsA(const TypeMatcher<MustachioResolutionError>()
.having((e) => e.message, 'message', contains('''
line 1, column 14 of ${barTemplateFile.path}: FileSystemException (File "${missingTemplateFile.path}" does not exist.) when reading partial:
throwsA(const TypeMatcher<MustachioResolutionError>().having(
(e) => e.message,
'message',
allOf(
contains('''
line 1, column 14 of ${barTemplateFile.path}: FileSystemException'''),
contains('''does not exist.'''),
contains('''when reading partial:
1 │ Text {{#foo}}{{>missing.mustache}}{{/foo}}
│ ^^^^^^^^^^^^^^^^^^^^^
'''))));
''')))));
});
}