File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,7 +19,18 @@ String _read(String name) {
1919 'generator? `dart run bin/df_generate_dart_models.dart '
2020 '-i test/integration/models -t templates/featured_v1.dart.md`' );
2121 }
22- return f.readAsStringSync ();
22+ return _unwrap (f.readAsStringSync ());
23+ }
24+
25+ /// Unwraps Dart-formatter line continuations so substring assertions can match
26+ /// semantic expressions regardless of how the formatter chose to break them.
27+ /// Joins each newline+indent into a single space, then strips whitespace before
28+ /// `.` so chained-method calls like `foo\n .bar` read as `foo.bar` .
29+ String _unwrap (String s) {
30+ s = s.replaceAll (RegExp (r'\n[ \t]*' ), ' ' );
31+ s = s.replaceAll (RegExp (r' +\.' ), '.' );
32+ s = s.replaceAll (RegExp (r' +' ), ' ' );
33+ return s;
2334}
2435
2536void main () {
You can’t perform that action at this time.
0 commit comments