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

Side by Side Diff: test/codegen/expect/language/enum_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('language/enum_test', null, /* Imports */[
2 'dart_sdk',
3 'expect'
4 ], function load__enum_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 enum_test = Object.create(null);
12 let JSArrayOfEnum1 = () => (JSArrayOfEnum1 = dart.constFn(_interceptors.JSArra y$(enum_test.Enum1)))();
13 let JSArrayOfEnum2 = () => (JSArrayOfEnum2 = dart.constFn(_interceptors.JSArra y$(enum_test.Enum2)))();
14 let JSArrayOfEnum3 = () => (JSArrayOfEnum3 = dart.constFn(_interceptors.JSArra y$(enum_test.Enum3)))();
15 let JSArrayOfEnum4 = () => (JSArrayOfEnum4 = dart.constFn(_interceptors.JSArra y$(enum_test.Enum4)))();
16 let JSArrayOfEnum5 = () => (JSArrayOfEnum5 = dart.constFn(_interceptors.JSArra y$(enum_test.Enum5)))();
17 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT ype(dart.dynamic, [])))();
18 let Enum1Todynamic = () => (Enum1Todynamic = dart.constFn(dart.definiteFunctio nType(dart.dynamic, [enum_test.Enum1])))();
19 let Enum2Todynamic = () => (Enum2Todynamic = dart.constFn(dart.definiteFunctio nType(dart.dynamic, [enum_test.Enum2])))();
20 let Enum3Todynamic = () => (Enum3Todynamic = dart.constFn(dart.definiteFunctio nType(dart.dynamic, [enum_test.Enum3])))();
21 let Enum4Todynamic = () => (Enum4Todynamic = dart.constFn(dart.definiteFunctio nType(dart.dynamic, [enum_test.Enum4])))();
22 let Enum5Todynamic = () => (Enum5Todynamic = dart.constFn(dart.definiteFunctio nType(dart.dynamic, [enum_test.Enum5])))();
23 enum_test.Enum1 = class Enum1 extends core.Object {
24 new(index) {
25 this.index = index;
26 }
27 toString() {
28 return {
29 0: "Enum1._"
30 }[this.index];
31 }
32 };
33 enum_test.Enum1._ = dart.const(new enum_test.Enum1(0));
34 enum_test.Enum1.values = dart.constList([enum_test.Enum1._], enum_test.Enum1);
35 enum_test.Enum2 = class Enum2 extends core.Object {
36 new(index) {
37 this.index = index;
38 }
39 toString() {
40 return {
41 0: "Enum2.A"
42 }[this.index];
43 }
44 };
45 enum_test.Enum2.A = dart.const(new enum_test.Enum2(0));
46 enum_test.Enum2.values = dart.constList([enum_test.Enum2.A], enum_test.Enum2);
47 enum_test.Enum3 = class Enum3 extends core.Object {
48 new(index) {
49 this.index = index;
50 }
51 toString() {
52 return {
53 0: "Enum3.B",
54 1: "Enum3.C"
55 }[this.index];
56 }
57 };
58 enum_test.Enum3.B = dart.const(new enum_test.Enum3(0));
59 enum_test.Enum3.C = dart.const(new enum_test.Enum3(1));
60 enum_test.Enum3.values = dart.constList([enum_test.Enum3.B, enum_test.Enum3.C] , enum_test.Enum3);
61 enum_test.Enum4 = class Enum4 extends core.Object {
62 new(index) {
63 this.index = index;
64 }
65 toString() {
66 return {
67 0: "Enum4.D",
68 1: "Enum4.E"
69 }[this.index];
70 }
71 };
72 enum_test.Enum4.D = dart.const(new enum_test.Enum4(0));
73 enum_test.Enum4.E = dart.const(new enum_test.Enum4(1));
74 enum_test.Enum4.values = dart.constList([enum_test.Enum4.D, enum_test.Enum4.E] , enum_test.Enum4);
75 enum_test.Enum5 = class Enum5 extends core.Object {
76 new(index) {
77 this.index = index;
78 }
79 toString() {
80 return {
81 0: "Enum5.F",
82 1: "Enum5.G",
83 2: "Enum5.H"
84 }[this.index];
85 }
86 };
87 enum_test.Enum5.F = dart.const(new enum_test.Enum5(0));
88 enum_test.Enum5.G = dart.const(new enum_test.Enum5(1));
89 enum_test.Enum5.H = dart.const(new enum_test.Enum5(2));
90 enum_test.Enum5.values = dart.constList([enum_test.Enum5.F, enum_test.Enum5.G, enum_test.Enum5.H], enum_test.Enum5);
91 enum_test.main = function() {
92 expect$.Expect.equals('Enum1._', enum_test.Enum1._.toString());
93 expect$.Expect.equals(0, enum_test.Enum1._.index);
94 expect$.Expect.listEquals(JSArrayOfEnum1().of([enum_test.Enum1._]), enum_tes t.Enum1.values);
95 enum_test.Enum1.values[dartx.forEach](enum_test.test1);
96 expect$.Expect.equals('Enum2.A', enum_test.Enum2.A.toString());
97 expect$.Expect.equals(0, enum_test.Enum2.A.index);
98 expect$.Expect.listEquals(JSArrayOfEnum2().of([enum_test.Enum2.A]), enum_tes t.Enum2.values);
99 enum_test.Enum2.values[dartx.forEach](enum_test.test2);
100 expect$.Expect.equals('Enum3.B', enum_test.Enum3.B.toString());
101 expect$.Expect.equals('Enum3.C', enum_test.Enum3.C.toString());
102 expect$.Expect.equals(0, enum_test.Enum3.B.index);
103 expect$.Expect.equals(1, enum_test.Enum3.C.index);
104 expect$.Expect.listEquals(JSArrayOfEnum3().of([enum_test.Enum3.B, enum_test. Enum3.C]), enum_test.Enum3.values);
105 enum_test.Enum3.values[dartx.forEach](enum_test.test3);
106 expect$.Expect.equals('Enum4.D', enum_test.Enum4.D.toString());
107 expect$.Expect.equals('Enum4.E', enum_test.Enum4.E.toString());
108 expect$.Expect.equals(0, enum_test.Enum4.D.index);
109 expect$.Expect.equals(1, enum_test.Enum4.E.index);
110 expect$.Expect.listEquals(JSArrayOfEnum4().of([enum_test.Enum4.D, enum_test. Enum4.E]), enum_test.Enum4.values);
111 enum_test.Enum4.values[dartx.forEach](enum_test.test4);
112 expect$.Expect.equals('Enum5.F', enum_test.Enum5.F.toString());
113 expect$.Expect.equals('Enum5.G', enum_test.Enum5.G.toString());
114 expect$.Expect.equals('Enum5.H', enum_test.Enum5.H.toString());
115 expect$.Expect.equals(0, enum_test.Enum5.F.index);
116 expect$.Expect.equals(1, enum_test.Enum5.G.index);
117 expect$.Expect.equals(2, enum_test.Enum5.H.index);
118 expect$.Expect.listEquals(JSArrayOfEnum5().of([enum_test.Enum5.F, enum_test. Enum5.G, enum_test.Enum5.H]), enum_test.Enum5.values);
119 enum_test.Enum5.values[dartx.forEach](enum_test.test5);
120 };
121 dart.fn(enum_test.main, VoidTodynamic());
122 enum_test.test1 = function(e) {
123 let index = null;
124 switch (e) {
125 case enum_test.Enum1._:
126 {
127 index = 0;
128 break;
129 }
130 }
131 expect$.Expect.equals(e.index, index);
132 };
133 dart.fn(enum_test.test1, Enum1Todynamic());
134 enum_test.test2 = function(e) {
135 let index = null;
136 switch (e) {
137 case enum_test.Enum2.A:
138 {
139 index = 0;
140 break;
141 }
142 }
143 expect$.Expect.equals(e.index, index);
144 };
145 dart.fn(enum_test.test2, Enum2Todynamic());
146 enum_test.test3 = function(e) {
147 let index = null;
148 switch (e) {
149 case enum_test.Enum3.C:
150 {
151 index = 1;
152 break;
153 }
154 case enum_test.Enum3.B:
155 {
156 index = 0;
157 break;
158 }
159 }
160 expect$.Expect.equals(e.index, index);
161 };
162 dart.fn(enum_test.test3, Enum3Todynamic());
163 enum_test.test4 = function(e) {
164 let index = null;
165 switch (e) {
166 case enum_test.Enum4.D:
167 {
168 index = 0;
169 break;
170 }
171 case enum_test.Enum4.E:
172 {
173 index = 1;
174 break;
175 }
176 }
177 expect$.Expect.equals(e.index, index);
178 };
179 dart.fn(enum_test.test4, Enum4Todynamic());
180 enum_test.test5 = function(e) {
181 let index = null;
182 switch (e) {
183 case enum_test.Enum5.H:
184 {
185 index = 2;
186 break;
187 }
188 case enum_test.Enum5.F:
189 {
190 index = 0;
191 break;
192 }
193 case enum_test.Enum5.G:
194 {
195 index = 1;
196 break;
197 }
198 }
199 expect$.Expect.equals(e.index, index);
200 };
201 dart.fn(enum_test.test5, Enum5Todynamic());
202 // Exports:
203 exports.enum_test = enum_test;
204 });
OLDNEW
« no previous file with comments | « test/codegen/expect/language/enum_syntax_test_none_multi.js ('k') | test/codegen/expect/language/equality_test.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698