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

Side by Side Diff: test/utils_test.dart

Issue 1240863004: Upgrade to the new test runner. (Closed) Base URL: git@github.com:dart-lang/source_maps@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « test/run.dart ('k') | test/vlq_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /// Tests for the binary search utility algorithm. 5 /// Tests for the binary search utility algorithm.
6 library test.utils_test; 6 library test.utils_test;
7 7
8 import 'package:unittest/unittest.dart'; 8 import 'package:test/test.dart';
9 import 'package:source_maps/src/utils.dart'; 9 import 'package:source_maps/src/utils.dart';
10 10
11 main() { 11 main() {
12 group('binary search', () { 12 group('binary search', () {
13 test('empty', () { 13 test('empty', () {
14 expect(binarySearch([], (x) => true), -1); 14 expect(binarySearch([], (x) => true), -1);
15 }); 15 });
16 16
17 test('single element', () { 17 test('single element', () {
18 expect(binarySearch([1], (x) => true), 0); 18 expect(binarySearch([1], (x) => true), 0);
(...skipping 26 matching lines...) Expand all
45 } 45 }
46 46
47 _linearSearch(list, predicate) { 47 _linearSearch(list, predicate) {
48 if (list.length == 0) return -1; 48 if (list.length == 0) return -1;
49 for (int i = 0; i < list.length; i++) { 49 for (int i = 0; i < list.length; i++) {
50 if (predicate(list[i])) return i; 50 if (predicate(list[i])) return i;
51 } 51 }
52 return list.length; 52 return list.length;
53 } 53 }
54 54
OLDNEW
« no previous file with comments | « test/run.dart ('k') | test/vlq_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698