Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(611)

Unified Diff: pkg/stack_trace/test/trace_test.dart

Issue 12681036: Fix the stack_trace frame test on Windows as well. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/stack_trace/test/trace_test.dart
diff --git a/pkg/stack_trace/test/trace_test.dart b/pkg/stack_trace/test/trace_test.dart
index 711a412761bdb5318c73a0512226bebaa5b885c8..2cbe48d12ea9a0a4f7a133613bd538ca42914578 100644
--- a/pkg/stack_trace/test/trace_test.dart
+++ b/pkg/stack_trace/test/trace_test.dart
@@ -4,6 +4,7 @@
library trace_test;
+import 'dart:io';
import 'dart:uri';
import 'package:pathos/path.dart' as path;
@@ -90,9 +91,9 @@ void main() {
});
test('.toString() nicely formats the stack trace', () {
- var absolute = path.absolute(path.join('foo', 'bar.dart'));
+ var uri = _pathToFileUri(path.join('foo', 'bar.dart'));
var trace = new Trace.parse('''
-#0 Foo._bar (file://$absolute:42:21)
+#0 Foo._bar ($uri:42:21)
#1 zip.<anonymous closure>.zap (dart:async:0:2)
#2 zip.<anonymous closure>.zap (http://pub.dartlang.org/thing.dart:1:100)
''');
@@ -132,3 +133,9 @@ dart:async bottom
'''));
});
}
+
+String _pathToFileUri(String pathString) {
+ pathString = path.absolute(pathString);
+ if (Platform.operatingSystem != 'windows') return 'file://$pathString';
+ return 'file:///${pathString.replaceAll("\\", "/")}';
+}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698