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

Side by Side Diff: pkg/stack_trace/test/frame_test.dart

Issue 13157004: Use the stack_trace library in scheduled_test. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 frame_test; 5 library frame_test;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 import 'dart:uri'; 8 import 'dart:uri';
9 9
10 import 'package:pathos/path.dart' as path; 10 import 'package:pathos/path.dart' as path;
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 }); 132 });
133 133
134 test('just returns the library for core libraries', () { 134 test('just returns the library for core libraries', () {
135 expect(new Frame.parse('#0 Foo (dart:core:5:10)').location, 135 expect(new Frame.parse('#0 Foo (dart:core:5:10)').location,
136 equals('dart:core')); 136 equals('dart:core'));
137 expect(new Frame.parse('#0 Foo (dart:async-patch:1:2)').location, 137 expect(new Frame.parse('#0 Foo (dart:async-patch:1:2)').location,
138 equals('dart:async-patch')); 138 equals('dart:async-patch'));
139 }); 139 });
140 }); 140 });
141 141
142 group('.package', () {
143 test('returns null for non-package URIs', () {
144 expect(new Frame.parse('#0 Foo (dart:async:0:0)').package, isNull);
145 expect(new Frame.parse('#0 Foo '
146 '(http://dartlang.org/stuff/thing.dart:0:0)').package,
147 isNull);
148 });
149
150 test('returns the package name for package: URIs', () {
151 expect(new Frame.parse('#0 Foo (package:foo/foo.dart:0:0)').package,
152 equals('foo'));
153 expect(new Frame.parse('#0 Foo (package:foo/zap/bar.dart:0:0)').package,
154 equals('foo'));
155 });
156 });
157
142 group('.toString()', () { 158 group('.toString()', () {
143 test('returns the library and line/column numbers for non-core ' 159 test('returns the library and line/column numbers for non-core '
144 'libraries', () { 160 'libraries', () {
145 expect(new Frame.parse('#0 Foo (http://dartlang.org/thing.dart:5:10)') 161 expect(new Frame.parse('#0 Foo (http://dartlang.org/thing.dart:5:10)')
146 .toString(), 162 .toString(),
147 equals('http://dartlang.org/thing.dart 5:10 in Foo')); 163 equals('http://dartlang.org/thing.dart 5:10 in Foo'));
148 }); 164 });
149 165
150 test('just returns the library for core libraries', () { 166 test('just returns the library for core libraries', () {
151 expect(new Frame.parse('#0 Foo (dart:core:5:10)').toString(), 167 expect(new Frame.parse('#0 Foo (dart:core:5:10)').toString(),
152 equals('dart:core in Foo')); 168 equals('dart:core in Foo'));
153 }); 169 });
154 170
155 test('converts "<anonymous closure>" to "<fn>"', () { 171 test('converts "<anonymous closure>" to "<fn>"', () {
156 expect(new Frame.parse('#0 Foo.<anonymous closure> (dart:core:5:10)') 172 expect(new Frame.parse('#0 Foo.<anonymous closure> (dart:core:5:10)')
157 .toString(), 173 .toString(),
158 equals('dart:core in Foo.<fn>')); 174 equals('dart:core in Foo.<fn>'));
159 }); 175 });
160 }); 176 });
161 } 177 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698