Skip to content

Commit

Permalink
Use a raw string for console logging with path (#2177)
Browse files Browse the repository at this point in the history
Fixes #2176

On windows a path can include a `\` followed by a letter that is not a
valid escape code in a Dart string. Prefix the string with `r` to make
it a raw string and log the path directly.
  • Loading branch information
natebosch authored Jan 24, 2024
1 parent fe3102e commit a5c4f01
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
## 1.25.2

* Fix a bug running browser tests with paths containing windows directory
separator follow by a character which is an invalid Dart string escape
sequence.

## 1.25.1

* Fix a bug where in precompiled mode, html files for tests were no longer
created.

* Support the latest version of `package:js`.
* Document the silent reporter in CLI help output.

Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/lib/src/runner/browser/compilers/dart2js.dart
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ class Dart2JsSupport extends CompilerSupport with JsHtmlWrapper {
import '${await absoluteUri(dartPath)}' as test;
void main() {
dom.window.console.log('Startup for test path $dartPath');
dom.window.console.log(r'Startup for test path $dartPath');
internalBootstrapBrowserTest(() => test.main);
}
''';
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test
version: 1.25.1
version: 1.25.2
description: >-
A full featured library for writing and running Dart tests across platforms.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test
Expand Down

0 comments on commit a5c4f01

Please sign in to comment.