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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 /*
2 * Copyright 2014 Google Inc. All rights reserved.
3 *
4 * Use of this source code is governed by a BSD-style
5 * license that can be found in the LICENSE file or at
6 * https://developers.google.com/open-source/licenses/bsd
7 */
8
9 part of charted.test.core;
10
11 testLists() {
12 group('sum()', () {
13 test('adds all elements in a list', () {
14 expect(sum([10, 20, 30, -10]), equals(50));
15 });
16
17 test('returns 0 when the list is null or empty', () {
18 expect(sum([]), equals(0));
19 expect(sum(null), equals(0));
20 });
21 });
22
23 group('Range', () {
24 test('throws ArgumentError when range is infinite', () {
25 expect(() => new Range(0, 1, 0), throwsArgumentError);
26 });
27 test('returns integers between 0 and [start] when only start is set', () {
28 expect(new Range(5), orderedEquals([0, 1, 2, 3, 4]));
29 });
30 test('returns a list of increasing step values '
31 'when start is less than stop', () {
32 expect(new Range(0, 5), orderedEquals([0, 1, 2, 3, 4]));
33 expect(new Range(10, 50, 10), orderedEquals([10, 20, 30, 40]));
34 expect(new Range(-6, 0, 1.2),
35 orderedEquals([-6, -4.8, -3.6, -2.4, -1.2]));
36 expect(new Range(1.2, 1.6, 0.2), orderedEquals([1.2, 1.4]));
37 });
38 test('returns a list of decreasing step values '
39 'when start is greater than stop', () {
40 expect(new Range(5, 0, -1), orderedEquals([5, 4, 3, 2, 1]));
41 expect(new Range(-1.2, -1.6, -0.2), orderedEquals([-1.2, -1.4]));
42 });
43 });
44 }
OLDNEW
« 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