OLD | NEW |
(Empty) | |
| 1 dart_library.library('corelib/queue_single_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__queue_single_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const collection = dart_sdk.collection; |
| 8 const dart = dart_sdk.dart; |
| 9 const dartx = dart_sdk.dartx; |
| 10 const expect$ = expect.expect; |
| 11 const queue_single_test = Object.create(null); |
| 12 let QueueOfint = () => (QueueOfint = dart.constFn(collection.Queue$(core.int))
)(); |
| 13 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 14 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
| 15 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 16 queue_single_test.main = function() { |
| 17 let queue1 = QueueOfint().new(); |
| 18 queue1.add(42); |
| 19 let queue2 = collection.Queue.new(); |
| 20 queue2.add(11); |
| 21 queue2.add(12); |
| 22 queue2.add(13); |
| 23 let queue3 = collection.Queue.new(); |
| 24 expect$.Expect.equals(42, queue1.single); |
| 25 expect$.Expect.throws(dart.fn(() => queue2.single, VoidTovoid()), dart.fn(e
=> core.StateError.is(e), dynamicTobool())); |
| 26 expect$.Expect.throws(dart.fn(() => queue3.single, VoidTovoid()), dart.fn(e
=> core.StateError.is(e), dynamicTobool())); |
| 27 }; |
| 28 dart.fn(queue_single_test.main, VoidTodynamic()); |
| 29 // Exports: |
| 30 exports.queue_single_test = queue_single_test; |
| 31 }); |
OLD | NEW |