OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 mock_compiler; | 5 library mock_compiler; |
6 | 6 |
7 import "package:expect/expect.dart"; | 7 import "package:expect/expect.dart"; |
8 import 'dart:async'; | 8 import 'dart:async'; |
9 import 'dart:collection'; | 9 import 'dart:collection'; |
10 | 10 |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 if (expectedIterator.hasNext) { | 363 if (expectedIterator.hasNext) { |
364 do { | 364 do { |
365 var expected = expectedIterator.next(); | 365 var expected = expectedIterator.next(); |
366 if (expected is CheckMessage) expected = expected(null); | 366 if (expected is CheckMessage) expected = expected(null); |
367 print('Expected $kind "${expected}" did not occur'); | 367 print('Expected $kind "${expected}" did not occur'); |
368 } while (expectedIterator.hasNext); | 368 } while (expectedIterator.hasNext); |
369 fail('Too few ${kind}s'); | 369 fail('Too few ${kind}s'); |
370 } | 370 } |
371 if (foundIterator.hasNext) { | 371 if (foundIterator.hasNext) { |
372 do { | 372 do { |
373 print('Additional $kind "${foundIterator.next()}"'); | 373 WarningMessage message = foundIterator.next(); |
| 374 print('Additional $kind "${message}: ${message.message}"'); |
374 } while (foundIterator.hasNext); | 375 } while (foundIterator.hasNext); |
375 fail('Too many ${kind}s'); | 376 fail('Too many ${kind}s'); |
376 } | 377 } |
377 } | 378 } |
378 | 379 |
379 class CollectingTreeElements extends TreeElementMapping { | 380 class CollectingTreeElements extends TreeElementMapping { |
380 final Map<Node, Element> map = new LinkedHashMap<Node, Element>(); | 381 final Map<Node, Element> map = new LinkedHashMap<Node, Element>(); |
381 | 382 |
382 CollectingTreeElements(Element currentElement) : super(currentElement); | 383 CollectingTreeElements(Element currentElement) : super(currentElement); |
383 | 384 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 MockElement(Element enclosingElement) | 430 MockElement(Element enclosingElement) |
430 : super('', ElementKind.FUNCTION, Modifiers.EMPTY, | 431 : super('', ElementKind.FUNCTION, Modifiers.EMPTY, |
431 enclosingElement); | 432 enclosingElement); |
432 | 433 |
433 get node => null; | 434 get node => null; |
434 | 435 |
435 parseNode(_) => null; | 436 parseNode(_) => null; |
436 | 437 |
437 bool get hasNode => false; | 438 bool get hasNode => false; |
438 } | 439 } |
OLD | NEW |