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

Unified Diff: test/codegen/expect/language/int_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/int_test.js
diff --git a/test/codegen/expect/language/int_test.js b/test/codegen/expect/language/int_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..77a3f5cc2be15d2b45eb24391da5ff68a8451bf6
--- /dev/null
+++ b/test/codegen/expect/language/int_test.js
@@ -0,0 +1,64 @@
+dart_library.library('language/int_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__int_test(exports, dart_sdk, expect) {
+ 'use strict';
+ const core = dart_sdk.core;
+ const dart = dart_sdk.dart;
+ const dartx = dart_sdk.dartx;
+ const expect$ = expect.expect;
+ const int_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ int_test.IntTest = class IntTest extends core.Object {
+ static testMain() {
+ expect$.Expect.equals(0, 0 + 0);
+ expect$.Expect.equals(1, 1 + 0);
+ expect$.Expect.equals(2, 1 + 1);
+ expect$.Expect.equals(3, -1 + 4);
+ expect$.Expect.equals(3, 4 + -1);
+ expect$.Expect.equals(1, 1 - 0);
+ expect$.Expect.equals(0, 1 - 1);
+ expect$.Expect.equals(1, 2 - 1);
+ expect$.Expect.equals(2, 4 - 2);
+ expect$.Expect.equals(-2, 2 - 4);
+ expect$.Expect.equals(0, 3 * 0);
+ expect$.Expect.equals(0, 0 * 3);
+ expect$.Expect.equals(1, 1 * 1);
+ expect$.Expect.equals(5, 5 * 1);
+ expect$.Expect.equals(15, 3 * 5);
+ expect$.Expect.equals(-1, 1 * -1);
+ expect$.Expect.equals(-15, -5 * 3);
+ expect$.Expect.equals(15, -5 * -3);
+ expect$.Expect.equals(1, (2 / 2)[dartx.truncate]());
+ expect$.Expect.equals(2, (2 / 1)[dartx.truncate]());
+ expect$.Expect.equals(2, (4 / 2)[dartx.truncate]());
+ expect$.Expect.equals(2, (5 / 2)[dartx.truncate]());
+ expect$.Expect.equals(-2, (-5 / 2)[dartx.truncate]());
+ expect$.Expect.equals(-2, (-4 / 2)[dartx.truncate]());
+ expect$.Expect.equals(-2, (5 / -2)[dartx.truncate]());
+ expect$.Expect.equals(-2, (4 / -2)[dartx.truncate]());
+ expect$.Expect.equals(3, (7)[dartx['%']](4));
+ expect$.Expect.equals(2, (9)[dartx['%']](7));
+ expect$.Expect.equals(2, (-7)[dartx['%']](9));
+ expect$.Expect.equals(7, (7)[dartx['%']](-9));
+ expect$.Expect.equals(7, (7)[dartx['%']](9));
+ expect$.Expect.equals(2, (-7)[dartx['%']](-9));
+ expect$.Expect.equals(3, (7)[dartx.remainder](4));
+ expect$.Expect.equals(2, (9)[dartx.remainder](7));
+ expect$.Expect.equals(-7, (-7)[dartx.remainder](9));
+ expect$.Expect.equals(7, (7)[dartx.remainder](-9));
+ expect$.Expect.equals(7, (7)[dartx.remainder](9));
+ expect$.Expect.equals(-7, (-7)[dartx.remainder](-9));
+ }
+ };
+ dart.setSignature(int_test.IntTest, {
+ statics: () => ({testMain: dart.definiteFunctionType(dart.void, [])}),
+ names: ['testMain']
+ });
+ int_test.main = function() {
+ int_test.IntTest.testMain();
+ };
+ dart.fn(int_test.main, VoidTodynamic());
+ // Exports:
+ exports.int_test = int_test;
+});
« no previous file with comments | « test/codegen/expect/language/int2_test.js ('k') | test/codegen/expect/language/integer_division_by_zero_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698