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

Unified Diff: test/codegen/expect/language/div_by_zero_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/div_by_zero_test.js
diff --git a/test/codegen/expect/language/div_by_zero_test.js b/test/codegen/expect/language/div_by_zero_test.js
new file mode 100644
index 0000000000000000000000000000000000000000..eabed95d4568305ca8fcb12d6e022c02bb80687d
--- /dev/null
+++ b/test/codegen/expect/language/div_by_zero_test.js
@@ -0,0 +1,47 @@
+dart_library.library('language/div_by_zero_test', null, /* Imports */[
+ 'dart_sdk',
+ 'expect'
+], function load__div_by_zero_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 div_by_zero_test = Object.create(null);
+ let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [])))();
+ div_by_zero_test.DivByZeroTest = class DivByZeroTest extends core.Object {
+ static divBy(a, b) {
+ let result = dart.notNull(a) / dart.notNull(b);
+ return 1.0 * result;
+ }
+ static moustacheDivBy(a, b) {
+ let val = null;
+ try {
+ val = (dart.notNull(a) / dart.notNull(b))[dartx.truncate]();
+ } catch (e) {
+ return true;
+ }
+
+ core.print(dart.str`Should not have gotten: ${val}`);
+ return false;
+ }
+ static testMain() {
+ expect$.Expect.isTrue(div_by_zero_test.DivByZeroTest.divBy(0, 0)[dartx.isNaN]);
+ expect$.Expect.isTrue(div_by_zero_test.DivByZeroTest.moustacheDivBy(0, 0));
+ }
+ };
+ dart.setSignature(div_by_zero_test.DivByZeroTest, {
+ statics: () => ({
+ divBy: dart.definiteFunctionType(core.double, [core.int, core.int]),
+ moustacheDivBy: dart.definiteFunctionType(core.bool, [core.int, core.int]),
+ testMain: dart.definiteFunctionType(dart.void, [])
+ }),
+ names: ['divBy', 'moustacheDivBy', 'testMain']
+ });
+ div_by_zero_test.main = function() {
+ div_by_zero_test.DivByZeroTest.testMain();
+ };
+ dart.fn(div_by_zero_test.main, VoidTodynamic());
+ // Exports:
+ exports.div_by_zero_test = div_by_zero_test;
+});
« no previous file with comments | « test/codegen/expect/language/disassemble_test.js ('k') | test/codegen/expect/language/div_with_power_of_two2_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698