Skip to content

Commit 5e2f187

Browse files
committed
update
1 parent 412a5ba commit 5e2f187

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

test/integration/integration_test.dart

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff 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

2536
void main() {

0 commit comments

Comments
 (0)