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

Side by Side Diff: packages/charted/test.disabled/core/math_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 testMath() {
12 test('toRadius() correctly converts degrees to radians', () {
13 expect(toRadians(0), equals(0));
14 expect(toRadians(180), equals(math.PI));
15 expect(toRadians(360), equals(math.PI * 2));
16 expect(toRadians(90), equals(math.PI / 2));
17 expect(toRadians(30), equals(math.PI / 6));
18 expect(toRadians(45), equals(math.PI / 4));
19 });
20
21 test('toDegrees() correctly converts radians to degrees', () {
22 expect(toDegrees(0), closeTo(0, EPSILON));
23 expect(toDegrees(math.PI), closeTo(180, EPSILON));
24 expect(toDegrees(math.PI * 2), closeTo(360, EPSILON));
25 expect(toDegrees(math.PI / 2), closeTo(90, EPSILON));
26 expect(toDegrees(math.PI / 6), closeTo(30, EPSILON));
27 expect(toDegrees(math.PI / 4), closeTo(45, EPSILON));
28 });
29
30 test('sinh() correctly calculates sinh', () {
31 expect(sinh(0), equals(0));
32 expect(sinh(0.5), closeTo(0.5210953054937474, EPSILON));
33 expect(sinh(1), closeTo(1.1752011936438014, EPSILON));
34 expect(sinh(-0.5), closeTo(-0.5210953054937474, EPSILON));
35 expect(sinh(-1), closeTo(-1.1752011936438014, EPSILON));
36 });
37
38 test('cosh() correctly calculates cosh', () {
39 expect(cosh(0), equals(1));
40 expect(cosh(0.5), closeTo(1.1276259652063807, EPSILON));
41 expect(cosh(1), closeTo(1.5430806348152437, EPSILON));
42 expect(cosh(-0.5), closeTo(1.1276259652063807, EPSILON));
43 expect(cosh(-1), closeTo(1.5430806348152437, EPSILON));
44 });
45
46 test('tanh() correctly calculates cosh', () {
47 expect(tanh(0), equals(0));
48 expect(tanh(0.5), closeTo(0.46211715726000974, EPSILON));
49 expect(tanh(1), closeTo(0.7615941559557649, EPSILON));
50 expect(tanh(-0.5), closeTo(-0.46211715726000974, EPSILON));
51 expect(tanh(-1), closeTo(-0.7615941559557649, EPSILON));
52 });
53 }
OLDNEW
« no previous file with comments | « packages/charted/test.disabled/core/lists_test.dart ('k') | packages/charted/test.disabled/core/namespace_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698