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

Unified Diff: test/codegen/expect/language/intrinsified_methods_test.js

Issue 2128353002: Check in codegen test expectations. (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: test/codegen/expect/language/intrinsified_methods_test.js
diff --git a/test/codegen/expect/language/intrinsified_methods_test.js b/test/codegen/expect/language/intrinsified_methods_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..81fbbe571351fe8128f3e9ca5c6406dd7f6f6cad
--- /dev/null
+++ b/test/codegen/expect/language/intrinsified_methods_test.js
@@ -0,0 +1,53 @@
+dart_library.library('language/intrinsified_methods_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__intrinsified_methods_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const math = dart_sdk.math;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const intrinsified_methods_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ let intTonum = () => (intTonum = dart.constFn(dart.definiteFunctionType(core.num, [core.int])))();
+ let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(dart.void, [])))();
+ intrinsified_methods_test.testIsNegative = function() {
+ expect$.Expect.isFalse(12.0[dartx.isNegative]);
+ expect$.Expect.isTrue((-12.0)[dartx.isNegative]);
+ expect$.Expect.isFalse(core.double.NAN[dartx.isNegative]);
+ expect$.Expect.isFalse(0.0[dartx.isNegative]);
+ expect$.Expect.isTrue((-0.0)[dartx.isNegative]);
+ expect$.Expect.isFalse(core.double.INFINITY[dartx.isNegative]);
+ expect$.Expect.isTrue(core.double.NEGATIVE_INFINITY[dartx.isNegative]);
+ };
+ dart.fn(intrinsified_methods_test.testIsNegative, VoidTodynamic());
+ intrinsified_methods_test.testIsNaN = function() {
+ expect$.Expect.isFalse(1.0[dartx.isNaN]);
+ expect$.Expect.isTrue(core.double.NAN[dartx.isNaN]);
+ };
+ dart.fn(intrinsified_methods_test.testIsNaN, VoidTodynamic());
+ intrinsified_methods_test.testTrigonometric = function() {
+ expect$.Expect.approxEquals(1.0, math.sin(math.PI / 2.0), 0.0001);
+ expect$.Expect.approxEquals(1.0, math.cos(0), 0.0001);
+ expect$.Expect.approxEquals(1.0, math.cos(0.0), 0.0001);
+ };
+ dart.fn(intrinsified_methods_test.testTrigonometric, VoidTodynamic());
+ intrinsified_methods_test.foo = function(n) {
+ let x = null;
+ for (let i = 0; i <= dart.notNull(n); ++i) {
+ expect$.Expect.equals(2.0, math.sqrt(4.0));
+ intrinsified_methods_test.testIsNegative();
+ intrinsified_methods_test.testIsNaN();
+ intrinsified_methods_test.testTrigonometric();
+ }
+ return core.num._check(x);
+ };
+ dart.fn(intrinsified_methods_test.foo, intTonum());
+ intrinsified_methods_test.main = function() {
+ let m = intrinsified_methods_test.foo(4000);
+ };
+ dart.fn(intrinsified_methods_test.main, VoidTovoid());
+ // Exports:
+ exports.intrinsified_methods_test = intrinsified_methods_test;
+});

Powered by Google App Engine
This is Rietveld 408576698