| 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 /** | 5 /** |
| 6 * The error formatter for mocking is a bit different from the default one | 6 * The error formatter for mocking is a bit different from the default one |
| 7 * for unit testing; instead of the third argument being a 'reason' | 7 * for unit testing; instead of the third argument being a 'reason' |
| 8 * it is instead a [signature] describing the method signature filter | 8 * it is instead a [signature] describing the method signature filter |
| 9 * that was used to select the logs that were verified. | 9 * that was used to select the logs that were verified. |
| 10 */ | 10 */ |
| (...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 774 for (var i = scratch.length - numToCopy; i < scratch.length; i++) { | 774 for (var i = scratch.length - numToCopy; i < scratch.length; i++) { |
| 775 rtn.logs.add(scratch[i]); | 775 rtn.logs.add(scratch[i]); |
| 776 } | 776 } |
| 777 scratch.clear(); | 777 scratch.clear(); |
| 778 } else { | 778 } else { |
| 779 remainingCount = distance > 0 ? distance : logs.length; | 779 remainingCount = distance > 0 ? distance : logs.length; |
| 780 } | 780 } |
| 781 if (includeKeys) { | 781 if (includeKeys) { |
| 782 rtn.logs.add(keyEntry); | 782 rtn.logs.add(keyEntry); |
| 783 } | 783 } |
| 784 if (keyIterator.hasNext()) { | 784 if (keyIterator.hasNext) { |
| 785 keyEntry = keyIterator.next(); | 785 keyEntry = keyIterator.next(); |
| 786 } else if (isPreceding) { // We're done. | 786 } else if (isPreceding) { // We're done. |
| 787 break; | 787 break; |
| 788 } | 788 } |
| 789 } else if (remainingCount > 0 && | 789 } else if (remainingCount > 0 && |
| 790 mockNameFilter.matches(logEntry.mockName, matchState) && | 790 mockNameFilter.matches(logEntry.mockName, matchState) && |
| 791 logFilter(logEntry)) { | 791 logFilter(logEntry)) { |
| 792 if (scratch != null) { | 792 if (scratch != null) { |
| 793 scratch.add(logEntry); | 793 scratch.add(logEntry); |
| 794 } else { | 794 } else { |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1450 } | 1450 } |
| 1451 } | 1451 } |
| 1452 } | 1452 } |
| 1453 | 1453 |
| 1454 /** Clear both logs and behavior. */ | 1454 /** Clear both logs and behavior. */ |
| 1455 void reset() { | 1455 void reset() { |
| 1456 resetBehavior(); | 1456 resetBehavior(); |
| 1457 clearLogs(); | 1457 clearLogs(); |
| 1458 } | 1458 } |
| 1459 } | 1459 } |
| OLD | NEW |