OLD | NEW |
1 dart_library.library('language/bool_test', null, /* Imports */[ | 1 dart_library.library('language/bool_test', null, /* Imports */[ |
2 'dart_sdk', | 2 'dart_sdk', |
3 'expect' | 3 'expect' |
4 ], function load__bool_test(exports, dart_sdk, expect) { | 4 ], function load__bool_test(exports, dart_sdk, expect) { |
5 'use strict'; | 5 'use strict'; |
6 const core = dart_sdk.core; | 6 const core = dart_sdk.core; |
7 const dart = dart_sdk.dart; | 7 const dart = dart_sdk.dart; |
8 const dartx = dart_sdk.dartx; | 8 const dartx = dart_sdk.dartx; |
9 const expect$ = expect.expect; | 9 const expect$ = expect.expect; |
10 const bool_test = Object.create(null); | 10 const bool_test = Object.create(null); |
11 let dynamicAnddynamicAnddynamicTodynamic = () => (dynamicAnddynamicAnddynamicT
odynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, d
art.dynamic, dart.dynamic])))(); | 11 let dynamicAnddynamicAnddynamicTodynamic = () => (dynamicAnddynamicAnddynamicT
odynamic = dart.constFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, d
art.dynamic, dart.dynamic])))(); |
| 12 let VoidTobool = () => (VoidTobool = dart.constFn(dart.definiteFunctionType(co
re.bool, [])))(); |
12 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); | 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
13 bool_test.BoolTest = class BoolTest extends core.Object { | 14 bool_test.BoolTest = class BoolTest extends core.Object { |
14 static testEquality() { | 15 static testEquality() { |
15 expect$.Expect.equals(true, true); | 16 expect$.Expect.equals(true, true); |
16 expect$.Expect.equals(false, false); | 17 expect$.Expect.equals(false, false); |
17 expect$.Expect.isTrue(core.identical(true, true)); | 18 expect$.Expect.isTrue(core.identical(true, true)); |
18 expect$.Expect.isFalse(core.identical(true, false)); | 19 expect$.Expect.isFalse(core.identical(true, false)); |
19 expect$.Expect.isTrue(core.identical(false, false)); | 20 expect$.Expect.isTrue(core.identical(false, false)); |
20 expect$.Expect.isFalse(core.identical(false, true)); | 21 expect$.Expect.isFalse(core.identical(false, true)); |
21 expect$.Expect.isFalse(!core.identical(true, true)); | 22 expect$.Expect.isFalse(!core.identical(true, true)); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 expect$.Expect.equals(false, testOr(isFalse, 1, false)); | 156 expect$.Expect.equals(false, testOr(isFalse, 1, false)); |
156 expect$.Expect.equals(true, testOr(0, isTrue, true)); | 157 expect$.Expect.equals(true, testOr(0, isTrue, true)); |
157 expect$.Expect.equals(true, testOr(1, isTrue, true)); | 158 expect$.Expect.equals(true, testOr(1, isTrue, true)); |
158 expect$.Expect.equals(false, testOr(0, isFalse, false)); | 159 expect$.Expect.equals(false, testOr(0, isFalse, false)); |
159 expect$.Expect.equals(false, testOr(1, isFalse, false)); | 160 expect$.Expect.equals(false, testOr(1, isFalse, false)); |
160 let trueCount = 0, falseCount = 0; | 161 let trueCount = 0, falseCount = 0; |
161 function trueFunc() { | 162 function trueFunc() { |
162 trueCount = dart.notNull(trueCount) + 1; | 163 trueCount = dart.notNull(trueCount) + 1; |
163 return true; | 164 return true; |
164 } | 165 } |
165 dart.fn(trueFunc, VoidTodynamic()); | 166 dart.fn(trueFunc, VoidTobool()); |
166 function falseFunc() { | 167 function falseFunc() { |
167 falseCount++; | 168 falseCount++; |
168 return false; | 169 return false; |
169 } | 170 } |
170 dart.fn(falseFunc, VoidTodynamic()); | 171 dart.fn(falseFunc, VoidTobool()); |
171 expect$.Expect.equals(0, trueCount); | 172 expect$.Expect.equals(0, trueCount); |
172 expect$.Expect.equals(0, falseCount); | 173 expect$.Expect.equals(0, falseCount); |
173 dart.test(trueFunc()) && dart.test(trueFunc()); | 174 dart.test(trueFunc()) && dart.test(trueFunc()); |
174 expect$.Expect.equals(2, trueCount); | 175 expect$.Expect.equals(2, trueCount); |
175 expect$.Expect.equals(0, falseCount); | 176 expect$.Expect.equals(0, falseCount); |
176 trueCount = falseCount = 0; | 177 trueCount = falseCount = 0; |
177 dart.test(falseFunc()) && dart.test(trueFunc()); | 178 dart.test(falseFunc()) && dart.test(trueFunc()); |
178 expect$.Expect.equals(0, trueCount); | 179 expect$.Expect.equals(0, trueCount); |
179 expect$.Expect.equals(1, falseCount); | 180 expect$.Expect.equals(1, falseCount); |
180 trueCount = falseCount = 0; | 181 trueCount = falseCount = 0; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 }), | 220 }), |
220 names: ['testEquality', 'testToString', 'testNegate', 'testLogicalOp', 'test
Main'] | 221 names: ['testEquality', 'testToString', 'testNegate', 'testLogicalOp', 'test
Main'] |
221 }); | 222 }); |
222 bool_test.main = function() { | 223 bool_test.main = function() { |
223 bool_test.BoolTest.testMain(); | 224 bool_test.BoolTest.testMain(); |
224 }; | 225 }; |
225 dart.fn(bool_test.main, VoidTodynamic()); | 226 dart.fn(bool_test.main, VoidTodynamic()); |
226 // Exports: | 227 // Exports: |
227 exports.bool_test = bool_test; | 228 exports.bool_test = bool_test; |
228 }); | 229 }); |
OLD | NEW |