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

Unified Diff: pkg/source_span/test/utils_test.dart

Issue 812253002: Delete a bunch of packages that are now on GitHub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Un-delete http Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/source_span/test/span_test.dart ('k') | pkg/stack_trace/CHANGELOG.md » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/source_span/test/utils_test.dart
diff --git a/pkg/source_span/test/utils_test.dart b/pkg/source_span/test/utils_test.dart
deleted file mode 100644
index 39211111e7c4b358dc253411c578618f586b8f12..0000000000000000000000000000000000000000
--- a/pkg/source_span/test/utils_test.dart
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-import 'package:unittest/unittest.dart';
-import 'package:source_span/src/utils.dart';
-
-main() {
- group('binary search', () {
- test('empty', () {
- expect(binarySearch([], (x) => true), -1);
- });
-
- test('single element', () {
- expect(binarySearch([1], (x) => true), 0);
- expect(binarySearch([1], (x) => false), 1);
- });
-
- test('no matches', () {
- var list = [1, 2, 3, 4, 5, 6, 7];
- expect(binarySearch(list, (x) => false), list.length);
- });
-
- test('all match', () {
- var list = [1, 2, 3, 4, 5, 6, 7];
- expect(binarySearch(list, (x) => true), 0);
- });
-
- test('compare with linear search', () {
- for (int size = 0; size < 100; size++) {
- var list = [];
- for (int i = 0; i < size; i++) {
- list.add(i);
- }
- for (int pos = 0; pos <= size; pos++) {
- expect(binarySearch(list, (x) => x >= pos),
- _linearSearch(list, (x) => x >= pos));
- }
- }
- });
- });
-}
-
-_linearSearch(list, predicate) {
- if (list.length == 0) return -1;
- for (int i = 0; i < list.length; i++) {
- if (predicate(list[i])) return i;
- }
- return list.length;
-}
-
« no previous file with comments | « pkg/source_span/test/span_test.dart ('k') | pkg/stack_trace/CHANGELOG.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698