OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 /// Utilities for creating unit tests of Barback transformers. | 5 /// Utilities for creating unit tests of Barback transformers. |
6 library code_transformers.src.test_harness; | 6 library code_transformers.src.test_harness; |
7 | 7 |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 | 9 |
10 import 'package:barback/barback.dart'; | 10 import 'package:barback/barback.dart'; |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 } | 157 } |
158 } | 158 } |
159 | 159 |
160 String _removeTrailingWhitespace(String str) => str.splitMapJoin('\n', | 160 String _removeTrailingWhitespace(String str) => str.splitMapJoin('\n', |
161 onNonMatch: (s) => s.replaceAll(new RegExp(r'\s+$'), '')); | 161 onNonMatch: (s) => s.replaceAll(new RegExp(r'\s+$'), '')); |
162 | 162 |
163 String _removeLeadingWhitespace(String str) => str.splitMapJoin('\n', | 163 String _removeLeadingWhitespace(String str) => str.splitMapJoin('\n', |
164 onNonMatch: (s) => s.replaceAll(new RegExp(r'^\s+'), '')); | 164 onNonMatch: (s) => s.replaceAll(new RegExp(r'^\s+'), '')); |
165 | 165 |
166 String _removeNewlines(String str) => str.replaceAll('\n', ''); | 166 String _removeNewlines(String str) => str.replaceAll('\n', ''); |
OLD | NEW |