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

Side by Side Diff: test/codegen/expect/corelib/iterable_first_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 unified diff | Download patch
OLDNEW
(Empty)
1 dart_library.library('corelib/iterable_first_test', null, /* Imports */[
2 'dart_sdk',
3 'expect'
4 ], function load__iterable_first_test(exports, dart_sdk, expect) {
5 'use strict';
6 const core = dart_sdk.core;
7 const _interceptors = dart_sdk._interceptors;
8 const dart = dart_sdk.dart;
9 const dartx = dart_sdk.dartx;
10 const expect$ = expect.expect;
11 const iterable_first_test = Object.create(null);
12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c ore.int)))();
13 let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSAr ray$(core.String)))();
14 let SetOfint = () => (SetOfint = dart.constFn(core.Set$(core.int)))();
15 let VoidToString = () => (VoidToString = dart.constFn(dart.definiteFunctionTyp e(core.String, [])))();
16 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT ype(core.bool, [dart.dynamic])))();
17 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da rt.void, [])))();
18 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
19 let const$;
20 iterable_first_test.main = function() {
21 let list1 = JSArrayOfint().of([1, 2, 3]);
22 let list2 = const$ || (const$ = dart.constList([4, 5], core.int));
23 let list3 = JSArrayOfString().of([]);
24 let set1 = SetOfint().new();
25 set1.add(11);
26 set1.add(12);
27 set1.add(13);
28 let set2 = core.Set.new();
29 expect$.Expect.equals(1, list1[dartx.first]);
30 expect$.Expect.equals(4, list2[dartx.first]);
31 expect$.Expect.throws(dart.fn(() => list3[dartx.first], VoidToString()), dar t.fn(e => core.StateError.is(e), dynamicTobool()));
32 expect$.Expect.isTrue(set1.contains(set1.first));
33 expect$.Expect.throws(dart.fn(() => set2.first, VoidTovoid()), dart.fn(e => core.StateError.is(e), dynamicTobool()));
34 };
35 dart.fn(iterable_first_test.main, VoidTodynamic());
36 // Exports:
37 exports.iterable_first_test = iterable_first_test;
38 });
OLDNEW
« no previous file with comments | « test/codegen/expect/corelib/iterable_expand_test.js ('k') | test/codegen/expect/corelib/iterable_first_where_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698