| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library matcher.pretty_print; | |
| 6 | |
| 7 import 'description.dart'; | 5 import 'description.dart'; |
| 8 import 'interfaces.dart'; | 6 import 'interfaces.dart'; |
| 9 import 'util.dart'; | 7 import 'util.dart'; |
| 10 | 8 |
| 11 /// Returns a pretty-printed representation of [object]. | 9 /// Returns a pretty-printed representation of [object]. |
| 12 /// | 10 /// |
| 13 /// If [maxLineLength] is passed, this will attempt to ensure that each line is | 11 /// If [maxLineLength] is passed, this will attempt to ensure that each line is |
| 14 /// no longer than [maxLineLength] characters long. This isn't guaranteed, since | 12 /// no longer than [maxLineLength] characters long. This isn't guaranteed, since |
| 15 /// individual objects may have string representations that are too long, but | 13 /// individual objects may have string representations that are too long, but |
| 16 /// most lines will be less than [maxLineLength] long. | 14 /// most lines will be less than [maxLineLength] long. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 return "?"; | 125 return "?"; |
| 128 } | 126 } |
| 129 } | 127 } |
| 130 | 128 |
| 131 /// Returns [source] with any control characters replaced by their escape | 129 /// Returns [source] with any control characters replaced by their escape |
| 132 /// sequences. | 130 /// sequences. |
| 133 /// | 131 /// |
| 134 /// This doesn't add quotes to the string, but it does escape single quote | 132 /// This doesn't add quotes to the string, but it does escape single quote |
| 135 /// characters so that single quotes can be applied externally. | 133 /// characters so that single quotes can be applied externally. |
| 136 String _escapeString(String source) => escape(source).replaceAll("'", r"\'"); | 134 String _escapeString(String source) => escape(source).replaceAll("'", r"\'"); |
| OLD | NEW |