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

Unified Diff: packages/charted/test.disabled/core/lists_test.dart

Issue 1400473008: Roll Observatory packages and add a roll script (Closed) Base URL: git@github.com:dart-lang/observatory_pub_packages.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: packages/charted/test.disabled/core/lists_test.dart
diff --git a/packages/charted/test.disabled/core/lists_test.dart b/packages/charted/test.disabled/core/lists_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..82a30cceb09961cbf3cfc5e2e852d5e17358b340
--- /dev/null
+++ b/packages/charted/test.disabled/core/lists_test.dart
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2014 Google Inc. All rights reserved.
+ *
+ * Use of this source code is governed by a BSD-style
+ * license that can be found in the LICENSE file or at
+ * https://developers.google.com/open-source/licenses/bsd
+ */
+
+part of charted.test.core;
+
+testLists() {
+ group('sum()', () {
+ test('adds all elements in a list', () {
+ expect(sum([10, 20, 30, -10]), equals(50));
+ });
+
+ test('returns 0 when the list is null or empty', () {
+ expect(sum([]), equals(0));
+ expect(sum(null), equals(0));
+ });
+ });
+
+ group('Range', () {
+ test('throws ArgumentError when range is infinite', () {
+ expect(() => new Range(0, 1, 0), throwsArgumentError);
+ });
+ test('returns integers between 0 and [start] when only start is set', () {
+ expect(new Range(5), orderedEquals([0, 1, 2, 3, 4]));
+ });
+ test('returns a list of increasing step values '
+ 'when start is less than stop', () {
+ expect(new Range(0, 5), orderedEquals([0, 1, 2, 3, 4]));
+ expect(new Range(10, 50, 10), orderedEquals([10, 20, 30, 40]));
+ expect(new Range(-6, 0, 1.2),
+ orderedEquals([-6, -4.8, -3.6, -2.4, -1.2]));
+ expect(new Range(1.2, 1.6, 0.2), orderedEquals([1.2, 1.4]));
+ });
+ test('returns a list of decreasing step values '
+ 'when start is greater than stop', () {
+ expect(new Range(5, 0, -1), orderedEquals([5, 4, 3, 2, 1]));
+ expect(new Range(-1.2, -1.6, -0.2), orderedEquals([-1.2, -1.4]));
+ });
+ });
+}
« no previous file with comments | « packages/charted/test.disabled/core/core_test.dart ('k') | packages/charted/test.disabled/core/math_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698