| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |