OLD | NEW |
(Empty) | |
| 1 dart_library.library('corelib/errors_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__errors_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 errors_test = Object.create(null); |
| 12 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); |
| 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 14 errors_test.main = function() { |
| 15 expect$.Expect.equals("Invalid argument(s)", new core.ArgumentError().toStri
ng()); |
| 16 expect$.Expect.equals("Invalid argument(s): message", new core.ArgumentError
("message").toString()); |
| 17 expect$.Expect.equals("Invalid argument: null", new core.ArgumentError.value
(null).toString()); |
| 18 expect$.Expect.equals("Invalid argument: 42", new core.ArgumentError.value(4
2).toString()); |
| 19 expect$.Expect.equals("Invalid argument: \"bad\"", new core.ArgumentError.va
lue("bad").toString()); |
| 20 expect$.Expect.equals("Invalid argument (foo): null", new core.ArgumentError
.value(null, "foo").toString()); |
| 21 expect$.Expect.equals("Invalid argument (foo): 42", new core.ArgumentError.v
alue(42, "foo").toString()); |
| 22 expect$.Expect.equals("Invalid argument (foo): message: 42", new core.Argume
ntError.value(42, "foo", "message").toString()); |
| 23 expect$.Expect.equals("Invalid argument: message: 42", new core.ArgumentErro
r.value(42, null, "message").toString()); |
| 24 expect$.Expect.equals("Invalid argument(s): Must not be null", new core.Argu
mentError.notNull().toString()); |
| 25 expect$.Expect.equals("Invalid argument(s) (foo): Must not be null", new cor
e.ArgumentError.notNull("foo").toString()); |
| 26 expect$.Expect.equals("RangeError", new core.RangeError(null).toString()); |
| 27 expect$.Expect.equals("RangeError: message", new core.RangeError("message").
toString()); |
| 28 expect$.Expect.equals("RangeError: Value not in range: 42", new core.RangeEr
ror.value(42).toString()); |
| 29 expect$.Expect.equals("RangeError (foo): Value not in range: 42", new core.R
angeError.value(42, "foo").toString()); |
| 30 expect$.Expect.equals("RangeError (foo): message: 42", new core.RangeError.v
alue(42, "foo", "message").toString()); |
| 31 expect$.Expect.equals("RangeError: message: 42", new core.RangeError.value(4
2, null, "message").toString()); |
| 32 expect$.Expect.equals("RangeError: Invalid value: Not in range 2..9, inclusi
ve: 42", new core.RangeError.range(42, 2, 9).toString()); |
| 33 expect$.Expect.equals("RangeError (foo): Invalid value: Not in range 2..9, "
+ "inclusive: 42", new core.RangeError.range(42, 2, 9, "foo").toString()); |
| 34 expect$.Expect.equals("RangeError (foo): message: Not in range 2..9, inclusi
ve: 42", new core.RangeError.range(42, 2, 9, "foo", "message").toString()); |
| 35 expect$.Expect.equals("RangeError: message: Not in range 2..9, inclusive: 42
", new core.RangeError.range(42, 2, 9, null, "message").toString()); |
| 36 expect$.Expect.equals("RangeError: Index out of range: " + "index should be
less than 3: 42", core.RangeError.index(42, JSArrayOfint().of([1, 2, 3])).toStri
ng()); |
| 37 expect$.Expect.equals("RangeError (foo): Index out of range: " + "index shou
ld be less than 3: 42", core.RangeError.index(42, JSArrayOfint().of([1, 2, 3]),
"foo").toString()); |
| 38 expect$.Expect.equals("RangeError (foo): message: " + "index should be less
than 3: 42", core.RangeError.index(42, JSArrayOfint().of([1, 2, 3]), "foo", "mes
sage").toString()); |
| 39 expect$.Expect.equals("RangeError: message: " + "index should be less than 3
: 42", core.RangeError.index(42, JSArrayOfint().of([1, 2, 3]), null, "message").
toString()); |
| 40 expect$.Expect.equals("RangeError (foo): message: " + "index should be less
than 2: 42", core.RangeError.index(42, JSArrayOfint().of([1, 2, 3]), "foo", "mes
sage", 2).toString()); |
| 41 expect$.Expect.equals("RangeError: Index out of range: " + "index must not b
e negative: -5", core.RangeError.index(-5, JSArrayOfint().of([1, 2, 3])).toStrin
g()); |
| 42 }; |
| 43 dart.fn(errors_test.main, VoidTodynamic()); |
| 44 // Exports: |
| 45 exports.errors_test = errors_test; |
| 46 }); |
OLD | NEW |