Chromium Code Reviews| Index: pkg/stack_trace/test/frame_test.dart |
| diff --git a/pkg/stack_trace/test/frame_test.dart b/pkg/stack_trace/test/frame_test.dart |
| index 97cf48a220c7cd7b2f8eae37863816d36184a0b9..2e5479dad404fe8d1263b3c325d4f8ffd7d88e11 100644 |
| --- a/pkg/stack_trace/test/frame_test.dart |
| +++ b/pkg/stack_trace/test/frame_test.dart |
| @@ -72,6 +72,42 @@ void main() { |
| expect(frame.member, equals('VW.call\$0')); |
| }); |
| + test('parses a stack frame with an absolute POSIX path correctly', () { |
| + var frame = new Frame.parseV8(" at VW.call\$0 " |
| + "(/path/to/stuff.dart.js:560:28)"); |
| + expect(frame.uri, equals(Uri.parse("file:///path/to/stuff.dart.js"))); |
| + expect(frame.line, equals(560)); |
| + expect(frame.column, equals(28)); |
| + expect(frame.member, equals('VW.call\$0')); |
| + }); |
| + |
| + test('parses a stack frame with an absolute Windows path correctly', () { |
| + var frame = new Frame.parseV8(" at VW.call\$0 " |
| + r"(C:\path\to\stuff.dart.js:560:28)"); |
| + expect(frame.uri, equals(Uri.parse("file:///C:/path/to/stuff.dart.js"))); |
| + expect(frame.line, equals(560)); |
| + expect(frame.column, equals(28)); |
| + expect(frame.member, equals('VW.call\$0')); |
| + }); |
|
Bob Nystrom
2013/11/07 22:25:10
Add a UNC path test too.
nweiz
2013/11/07 22:40:12
Done.
|
| + |
| + test('parses a stack frame with a relative POSIX path correctly', () { |
| + var frame = new Frame.parseV8(" at VW.call\$0 " |
| + "(path/to/stuff.dart.js:560:28)"); |
| + expect(frame.uri, equals(Uri.parse("path/to/stuff.dart.js"))); |
| + expect(frame.line, equals(560)); |
| + expect(frame.column, equals(28)); |
| + expect(frame.member, equals('VW.call\$0')); |
| + }); |
| + |
| + test('parses a stack frame with a relative Windows path correctly', () { |
| + var frame = new Frame.parseV8(" at VW.call\$0 " |
| + r"(path\to\stuff.dart.js:560:28)"); |
| + expect(frame.uri, equals(Uri.parse("path/to/stuff.dart.js"))); |
| + expect(frame.line, equals(560)); |
| + expect(frame.column, equals(28)); |
| + expect(frame.member, equals('VW.call\$0')); |
| + }); |
| + |
| test('parses an anonymous stack frame correctly', () { |
| var frame = new Frame.parseV8( |
| " at http://pub.dartlang.org/stuff.dart.js:560:28"); |
| @@ -135,6 +171,42 @@ void main() { |
| expect(frame.member, equals('VW.call\$0')); |
| }); |
| + test('parses a stack frame with an absolute POSIX path correctly', () { |
| + var frame = new Frame.parseFirefox( |
| + ".VW.call\$0@/path/to/stuff.dart.js:560"); |
| + expect(frame.uri, equals(Uri.parse("file:///path/to/stuff.dart.js"))); |
| + expect(frame.line, equals(560)); |
| + expect(frame.column, isNull); |
| + expect(frame.member, equals('VW.call\$0')); |
| + }); |
| + |
| + test('parses a stack frame with an absolute Windows path correctly', () { |
| + var frame = new Frame.parseFirefox( |
| + r".VW.call$0@C:\path\to\stuff.dart.js:560"); |
| + expect(frame.uri, equals(Uri.parse("file:///C:/path/to/stuff.dart.js"))); |
| + expect(frame.line, equals(560)); |
| + expect(frame.column, isNull); |
| + expect(frame.member, equals('VW.call\$0')); |
| + }); |
| + |
| + test('parses a stack frame with a relative POSIX path correctly', () { |
| + var frame = new Frame.parseFirefox( |
| + ".VW.call\$0@path/to/stuff.dart.js:560"); |
| + expect(frame.uri, equals(Uri.parse("path/to/stuff.dart.js"))); |
| + expect(frame.line, equals(560)); |
| + expect(frame.column, isNull); |
| + expect(frame.member, equals('VW.call\$0')); |
| + }); |
| + |
| + test('parses a stack frame with a relative Windows path correctly', () { |
| + var frame = new Frame.parseFirefox( |
| + r".VW.call$0@path\to\stuff.dart.js:560"); |
| + expect(frame.uri, equals(Uri.parse("path/to/stuff.dart.js"))); |
| + expect(frame.line, equals(560)); |
| + expect(frame.column, isNull); |
| + expect(frame.member, equals('VW.call\$0')); |
| + }); |
| + |
| test('parses a simple anonymous stack frame correctly', () { |
| var frame = new Frame.parseFirefox( |
| "@http://pub.dartlang.org/stuff.dart.js:560"); |