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

Unified Diff: test/frame_test.dart

Issue 2739643004: Fix friendly frame parsing bugs. (Closed)
Patch Set: Fix friendly frame parsing bugs. Created 3 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 | « pubspec.yaml ('k') | test/trace_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/frame_test.dart
diff --git a/test/frame_test.dart b/test/frame_test.dart
index 080c8b8ed5003d3783f2c119bfbaf5d7b91d7211..a5f8b234469e925e8a2250604f2ecbb3c9342e61 100644
--- a/test/frame_test.dart
+++ b/test/frame_test.dart
@@ -448,7 +448,7 @@ void main() {
expect(frame.member, equals('Foo.<fn>.bar'));
});
- test('parses a stack frame with no line correctly', () {
+ test('parses a stack frame with no column correctly', () {
var frame = new Frame.parseFriendly(
"http://dartlang.org/foo/bar.dart 10 Foo.<fn>.bar");
expect(frame.uri, equals(Uri.parse("http://dartlang.org/foo/bar.dart")));
@@ -472,6 +472,45 @@ void main() {
expectIsUnparsed((text) => new Frame.parseFriendly(text),
'foo/bar.dart 10:11');
});
+
+ test('parses a data url stack frame with no line or column correctly', () {
+ var frame = new Frame.parseFriendly(
+ "data:... main");
+ expect(frame.uri.scheme, equals('data'));
+ expect(frame.line, isNull);
+ expect(frame.column, isNull);
+ expect(frame.member, equals('main'));
+ });
+
+ test('parses a data url stack frame correctly', () {
+ var frame = new Frame.parseFriendly(
+ "data:... 10:11 main");
+ expect(frame.uri.scheme, equals('data'));
+ expect(frame.line, equals(10));
+ expect(frame.column, equals(11));
+ expect(frame.member, equals('main'));
+ });
+
+ test('parses a stack frame with spaces in the member name correctly', () {
+ var frame = new Frame.parseFriendly(
+ "foo/bar.dart 10:11 (anonymous function).dart.fn");
+ expect(frame.uri,
+ equals(path.toUri(path.absolute(path.join('foo', 'bar.dart')))));
+ expect(frame.line, equals(10));
+ expect(frame.column, equals(11));
+ expect(frame.member, equals('(anonymous function).dart.fn'));
+ });
+
+ test('parses a stack frame with spaces in the member name and no line or '
+ 'column correctly', () {
+ var frame = new Frame.parseFriendly(
+ "http://dartlang.org/foo/bar.dart (anonymous function).dart.fn");
+ expect(
+ frame.uri, equals(Uri.parse("http://dartlang.org/foo/bar.dart")));
+ expect(frame.line, isNull);
+ expect(frame.column, isNull);
+ expect(frame.member, equals('(anonymous function).dart.fn'));
+ });
});
test('only considers dart URIs to be core', () {
« no previous file with comments | « pubspec.yaml ('k') | test/trace_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698