| OLD | NEW |
| 1 dart_library.library('expect', null, /* Imports */[ | 1 dart_library.library('expect', null, /* Imports */[ |
| 2 "dart/_runtime", | 2 "dart/_runtime", |
| 3 'dart/core' | 3 'dart/core' |
| 4 ], /* Lazy imports */[ | 4 ], /* Lazy imports */[ |
| 5 ], function(exports, dart, core) { | 5 ], function(exports, dart, core) { |
| 6 'use strict'; | 6 'use strict'; |
| 7 let dartx = dart.dartx; | 7 let dartx = dart.dartx; |
| 8 class Expect extends core.Object { | 8 class Expect extends core.Object { |
| 9 static _truncateString(string, start, end, length) { | 9 static _truncateString(string, start, end, length) { |
| 10 if (dart.notNull(end) - dart.notNull(start) > dart.notNull(length)) { | 10 if (dart.notNull(end) - dart.notNull(start) > dart.notNull(length)) { |
| 11 end = dart.notNull(start) + dart.notNull(length); | 11 end = dart.notNull(start) + dart.notNull(length); |
| 12 } else if (dart.notNull(end) - dart.notNull(start) < dart.notNull(length))
{ | 12 } else if (dart.notNull(end) - dart.notNull(start) < dart.notNull(length))
{ |
| 13 let overflow = dart.notNull(length) - (dart.notNull(end) - dart.notNull(
start)); | 13 let overflow = dart.notNull(length) - (dart.notNull(end) - dart.notNull(
start)); |
| 14 if (dart.notNull(overflow) > 10) | 14 if (dart.notNull(overflow) > 10) overflow = 10; |
| 15 overflow = 10; | |
| 16 start = dart.notNull(start) - ((dart.notNull(overflow) + 1) / 2)[dartx.t
runcate](); | 15 start = dart.notNull(start) - ((dart.notNull(overflow) + 1) / 2)[dartx.t
runcate](); |
| 17 end = dart.notNull(end) + (dart.notNull(overflow) / 2)[dartx.truncate]()
; | 16 end = dart.notNull(end) + (dart.notNull(overflow) / 2)[dartx.truncate]()
; |
| 18 if (dart.notNull(start) < 0) | 17 if (dart.notNull(start) < 0) start = 0; |
| 19 start = 0; | 18 if (dart.notNull(end) > dart.notNull(string[dartx.length])) end = string
[dartx.length]; |
| 20 if (dart.notNull(end) > dart.notNull(string[dartx.length])) | |
| 21 end = string[dartx.length]; | |
| 22 } | 19 } |
| 23 if (start == 0 && end == string[dartx.length]) | 20 if (start == 0 && end == string[dartx.length]) return string; |
| 24 return string; | |
| 25 let buf = new core.StringBuffer(); | 21 let buf = new core.StringBuffer(); |
| 26 if (dart.notNull(start) > 0) | 22 if (dart.notNull(start) > 0) buf.write("..."); |
| 27 buf.write("..."); | |
| 28 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(
i) + 1) { | 23 for (let i = start; dart.notNull(i) < dart.notNull(end); i = dart.notNull(
i) + 1) { |
| 29 let code = string[dartx.codeUnitAt](i); | 24 let code = string[dartx.codeUnitAt](i); |
| 30 if (dart.notNull(code) < 32) { | 25 if (dart.notNull(code) < 32) { |
| 31 buf.write("\\x"); | 26 buf.write("\\x"); |
| 32 buf.write("0123456789abcdef"[dartx.get]((dart.notNull(code) / 16)[dart
x.truncate]())); | 27 buf.write("0123456789abcdef"[dartx.get]((dart.notNull(code) / 16)[dart
x.truncate]())); |
| 33 buf.write("0123456789abcdef"[dartx.get](dart.notNull(code) % 16)); | 28 buf.write("0123456789abcdef"[dartx.get](dart.notNull(code) % 16)); |
| 34 } else { | 29 } else { |
| 35 buf.writeCharCode(string[dartx.codeUnitAt](i)); | 30 buf.writeCharCode(string[dartx.codeUnitAt](i)); |
| 36 } | 31 } |
| 37 } | 32 } |
| 38 if (dart.notNull(end) < dart.notNull(string[dartx.length])) | 33 if (dart.notNull(end) < dart.notNull(string[dartx.length])) buf.write("...
"); |
| 39 buf.write("..."); | |
| 40 return dart.toString(buf); | 34 return dart.toString(buf); |
| 41 } | 35 } |
| 42 static _stringDifference(expected, actual) { | 36 static _stringDifference(expected, actual) { |
| 43 if (dart.notNull(expected[dartx.length]) < 20 && dart.notNull(actual[dartx
.length]) < 20) | 37 if (dart.notNull(expected[dartx.length]) < 20 && dart.notNull(actual[dartx
.length]) < 20) return null; |
| 44 return null; | |
| 45 for (let i = 0; dart.notNull(i) < dart.notNull(expected[dartx.length]) &&
dart.notNull(i) < dart.notNull(actual[dartx.length]); i = dart.notNull(i) + 1) { | 38 for (let i = 0; dart.notNull(i) < dart.notNull(expected[dartx.length]) &&
dart.notNull(i) < dart.notNull(actual[dartx.length]); i = dart.notNull(i) + 1) { |
| 46 if (expected[dartx.codeUnitAt](i) != actual[dartx.codeUnitAt](i)) { | 39 if (expected[dartx.codeUnitAt](i) != actual[dartx.codeUnitAt](i)) { |
| 47 let start = i; | 40 let start = i; |
| 48 i = dart.notNull(i) + 1; | 41 i = dart.notNull(i) + 1; |
| 49 while (dart.notNull(i) < dart.notNull(expected[dartx.length]) && dart.
notNull(i) < dart.notNull(actual[dartx.length])) { | 42 while (dart.notNull(i) < dart.notNull(expected[dartx.length]) && dart.
notNull(i) < dart.notNull(actual[dartx.length])) { |
| 50 if (expected[dartx.codeUnitAt](i) == actual[dartx.codeUnitAt](i)) | 43 if (expected[dartx.codeUnitAt](i) == actual[dartx.codeUnitAt](i)) br
eak; |
| 51 break; | |
| 52 i = dart.notNull(i) + 1; | 44 i = dart.notNull(i) + 1; |
| 53 } | 45 } |
| 54 let end = i; | 46 let end = i; |
| 55 let truncExpected = Expect._truncateString(expected, start, end, 20); | 47 let truncExpected = Expect._truncateString(expected, start, end, 20); |
| 56 let truncActual = Expect._truncateString(actual, start, end, 20); | 48 let truncActual = Expect._truncateString(actual, start, end, 20); |
| 57 return `at index ${start}: Expected <${truncExpected}>, ` + `Found: <$
{truncActual}>`; | 49 return `at index ${start}: Expected <${truncExpected}>, ` + `Found: <$
{truncActual}>`; |
| 58 } | 50 } |
| 59 } | 51 } |
| 60 return null; | 52 return null; |
| 61 } | 53 } |
| 62 static equals(expected, actual, reason) { | 54 static equals(expected, actual, reason) { |
| 63 if (reason === void 0) | 55 if (reason === void 0) reason = null; |
| 64 reason = null; | 56 if (dart.equals(expected, actual)) return; |
| 65 if (dart.equals(expected, actual)) | |
| 66 return; | |
| 67 let msg = Expect._getMessage(reason); | 57 let msg = Expect._getMessage(reason); |
| 68 if (typeof expected == 'string' && typeof actual == 'string') { | 58 if (typeof expected == 'string' && typeof actual == 'string') { |
| 69 let stringDifference = Expect._stringDifference(dart.as(expected, core.S
tring), dart.as(actual, core.String)); | 59 let stringDifference = Expect._stringDifference(dart.as(expected, core.S
tring), dart.as(actual, core.String)); |
| 70 if (stringDifference != null) { | 60 if (stringDifference != null) { |
| 71 Expect._fail(`Expect.equals(${stringDifference}${msg}) fails.`); | 61 Expect._fail(`Expect.equals(${stringDifference}${msg}) fails.`); |
| 72 } | 62 } |
| 73 } | 63 } |
| 74 Expect._fail(`Expect.equals(expected: <${expected}>, actual: <${actual}>${
msg}) fails.`); | 64 Expect._fail(`Expect.equals(expected: <${expected}>, actual: <${actual}>${
msg}) fails.`); |
| 75 } | 65 } |
| 76 static isTrue(actual, reason) { | 66 static isTrue(actual, reason) { |
| 77 if (reason === void 0) | 67 if (reason === void 0) reason = null; |
| 78 reason = null; | 68 if (dart.notNull(_identical(actual, true))) return; |
| 79 if (dart.notNull(_identical(actual, true))) | |
| 80 return; | |
| 81 let msg = Expect._getMessage(reason); | 69 let msg = Expect._getMessage(reason); |
| 82 Expect._fail(`Expect.isTrue(${actual}${msg}) fails.`); | 70 Expect._fail(`Expect.isTrue(${actual}${msg}) fails.`); |
| 83 } | 71 } |
| 84 static isFalse(actual, reason) { | 72 static isFalse(actual, reason) { |
| 85 if (reason === void 0) | 73 if (reason === void 0) reason = null; |
| 86 reason = null; | 74 if (dart.notNull(_identical(actual, false))) return; |
| 87 if (dart.notNull(_identical(actual, false))) | |
| 88 return; | |
| 89 let msg = Expect._getMessage(reason); | 75 let msg = Expect._getMessage(reason); |
| 90 Expect._fail(`Expect.isFalse(${actual}${msg}) fails.`); | 76 Expect._fail(`Expect.isFalse(${actual}${msg}) fails.`); |
| 91 } | 77 } |
| 92 static isNull(actual, reason) { | 78 static isNull(actual, reason) { |
| 93 if (reason === void 0) | 79 if (reason === void 0) reason = null; |
| 94 reason = null; | 80 if (null == actual) return; |
| 95 if (null == actual) | |
| 96 return; | |
| 97 let msg = Expect._getMessage(reason); | 81 let msg = Expect._getMessage(reason); |
| 98 Expect._fail(`Expect.isNull(actual: <${actual}>${msg}) fails.`); | 82 Expect._fail(`Expect.isNull(actual: <${actual}>${msg}) fails.`); |
| 99 } | 83 } |
| 100 static isNotNull(actual, reason) { | 84 static isNotNull(actual, reason) { |
| 101 if (reason === void 0) | 85 if (reason === void 0) reason = null; |
| 102 reason = null; | 86 if (null != actual) return; |
| 103 if (null != actual) | |
| 104 return; | |
| 105 let msg = Expect._getMessage(reason); | 87 let msg = Expect._getMessage(reason); |
| 106 Expect._fail(`Expect.isNotNull(actual: <${actual}>${msg}) fails.`); | 88 Expect._fail(`Expect.isNotNull(actual: <${actual}>${msg}) fails.`); |
| 107 } | 89 } |
| 108 static identical(expected, actual, reason) { | 90 static identical(expected, actual, reason) { |
| 109 if (reason === void 0) | 91 if (reason === void 0) reason = null; |
| 110 reason = null; | 92 if (dart.notNull(_identical(expected, actual))) return; |
| 111 if (dart.notNull(_identical(expected, actual))) | |
| 112 return; | |
| 113 let msg = Expect._getMessage(reason); | 93 let msg = Expect._getMessage(reason); |
| 114 Expect._fail(`Expect.identical(expected: <${expected}>, actual: <${actual}
>${msg}) ` + "fails."); | 94 Expect._fail(`Expect.identical(expected: <${expected}>, actual: <${actual}
>${msg}) ` + "fails."); |
| 115 } | 95 } |
| 116 static fail(msg) { | 96 static fail(msg) { |
| 117 Expect._fail(`Expect.fail('${msg}')`); | 97 Expect._fail(`Expect.fail('${msg}')`); |
| 118 } | 98 } |
| 119 static approxEquals(expected, actual, tolerance, reason) { | 99 static approxEquals(expected, actual, tolerance, reason) { |
| 120 if (tolerance === void 0) | 100 if (tolerance === void 0) tolerance = null; |
| 121 tolerance = null; | 101 if (reason === void 0) reason = null; |
| 122 if (reason === void 0) | |
| 123 reason = null; | |
| 124 if (tolerance == null) { | 102 if (tolerance == null) { |
| 125 tolerance = (dart.notNull(expected) / 10000.0)[dartx.abs](); | 103 tolerance = (dart.notNull(expected) / 10000.0)[dartx.abs](); |
| 126 } | 104 } |
| 127 if (dart.notNull((dart.notNull(expected) - dart.notNull(actual))[dartx.abs
]()) <= dart.notNull(tolerance)) | 105 if (dart.notNull((dart.notNull(expected) - dart.notNull(actual))[dartx.abs
]()) <= dart.notNull(tolerance)) return; |
| 128 return; | |
| 129 let msg = Expect._getMessage(reason); | 106 let msg = Expect._getMessage(reason); |
| 130 Expect._fail(`Expect.approxEquals(expected:<${expected}>, actual:<${actual
}>, ` + `tolerance:<${tolerance}>${msg}) fails`); | 107 Expect._fail(`Expect.approxEquals(expected:<${expected}>, actual:<${actual
}>, ` + `tolerance:<${tolerance}>${msg}) fails`); |
| 131 } | 108 } |
| 132 static notEquals(unexpected, actual, reason) { | 109 static notEquals(unexpected, actual, reason) { |
| 133 if (reason === void 0) | 110 if (reason === void 0) reason = null; |
| 134 reason = null; | 111 if (!dart.equals(unexpected, actual)) return; |
| 135 if (!dart.equals(unexpected, actual)) | |
| 136 return; | |
| 137 let msg = Expect._getMessage(reason); | 112 let msg = Expect._getMessage(reason); |
| 138 Expect._fail(`Expect.notEquals(unexpected: <${unexpected}>, actual:<${actu
al}>${msg}) ` + "fails."); | 113 Expect._fail(`Expect.notEquals(unexpected: <${unexpected}>, actual:<${actu
al}>${msg}) ` + "fails."); |
| 139 } | 114 } |
| 140 static listEquals(expected, actual, reason) { | 115 static listEquals(expected, actual, reason) { |
| 141 if (reason === void 0) | 116 if (reason === void 0) reason = null; |
| 142 reason = null; | |
| 143 let msg = Expect._getMessage(reason); | 117 let msg = Expect._getMessage(reason); |
| 144 let n = dart.notNull(expected[dartx.length]) < dart.notNull(actual[dartx.l
ength]) ? expected[dartx.length] : actual[dartx.length]; | 118 let n = dart.notNull(expected[dartx.length]) < dart.notNull(actual[dartx.l
ength]) ? expected[dartx.length] : actual[dartx.length]; |
| 145 for (let i = 0; dart.notNull(i) < dart.notNull(n); i = dart.notNull(i) + 1
) { | 119 for (let i = 0; dart.notNull(i) < dart.notNull(n); i = dart.notNull(i) + 1
) { |
| 146 if (!dart.equals(expected[dartx.get](i), actual[dartx.get](i))) { | 120 if (!dart.equals(expected[dartx.get](i), actual[dartx.get](i))) { |
| 147 Expect._fail(`Expect.listEquals(at index ${i}, ` + `expected: <${expec
ted[dartx.get](i)}>, actual: <${actual[dartx.get](i)}>${msg}) fails`); | 121 Expect._fail(`Expect.listEquals(at index ${i}, ` + `expected: <${expec
ted[dartx.get](i)}>, actual: <${actual[dartx.get](i)}>${msg}) fails`); |
| 148 } | 122 } |
| 149 } | 123 } |
| 150 if (expected[dartx.length] != actual[dartx.length]) { | 124 if (expected[dartx.length] != actual[dartx.length]) { |
| 151 Expect._fail('Expect.listEquals(list length, ' + `expected: <${expected[
dartx.length]}>, actual: <${actual[dartx.length]}>${msg}) ` + 'fails: Next eleme
nt <' + `${dart.notNull(expected[dartx.length]) > dart.notNull(n) ? expected[dar
tx.get](n) : actual[dartx.get](n)}>`); | 125 Expect._fail('Expect.listEquals(list length, ' + `expected: <${expected[
dartx.length]}>, actual: <${actual[dartx.length]}>${msg}) ` + 'fails: Next eleme
nt <' + `${dart.notNull(expected[dartx.length]) > dart.notNull(n) ? expected[dar
tx.get](n) : actual[dartx.get](n)}>`); |
| 152 } | 126 } |
| 153 } | 127 } |
| 154 static mapEquals(expected, actual, reason) { | 128 static mapEquals(expected, actual, reason) { |
| 155 if (reason === void 0) | 129 if (reason === void 0) reason = null; |
| 156 reason = null; | |
| 157 let msg = Expect._getMessage(reason); | 130 let msg = Expect._getMessage(reason); |
| 158 for (let key of expected.keys) { | 131 for (let key of expected.keys) { |
| 159 if (!dart.notNull(actual.containsKey(key))) { | 132 if (!dart.notNull(actual.containsKey(key))) { |
| 160 Expect._fail(`Expect.mapEquals(missing expected key: <${key}>${msg}) f
ails`); | 133 Expect._fail(`Expect.mapEquals(missing expected key: <${key}>${msg}) f
ails`); |
| 161 } | 134 } |
| 162 Expect.equals(expected.get(key), actual.get(key)); | 135 Expect.equals(expected.get(key), actual.get(key)); |
| 163 } | 136 } |
| 164 for (let key of actual.keys) { | 137 for (let key of actual.keys) { |
| 165 if (!dart.notNull(expected.containsKey(key))) { | 138 if (!dart.notNull(expected.containsKey(key))) { |
| 166 Expect._fail(`Expect.mapEquals(unexpected key: <${key}>${msg}) fails`)
; | 139 Expect._fail(`Expect.mapEquals(unexpected key: <${key}>${msg}) fails`)
; |
| 167 } | 140 } |
| 168 } | 141 } |
| 169 } | 142 } |
| 170 static stringEquals(expected, actual, reason) { | 143 static stringEquals(expected, actual, reason) { |
| 171 if (reason === void 0) | 144 if (reason === void 0) reason = null; |
| 172 reason = null; | 145 if (expected == actual) return; |
| 173 if (expected == actual) | |
| 174 return; | |
| 175 let msg = Expect._getMessage(reason); | 146 let msg = Expect._getMessage(reason); |
| 176 let defaultMessage = `Expect.stringEquals(expected: <${expected}>", <${act
ual}>${msg}) fails`; | 147 let defaultMessage = `Expect.stringEquals(expected: <${expected}>", <${act
ual}>${msg}) fails`; |
| 177 if (expected == null || actual == null) { | 148 if (expected == null || actual == null) { |
| 178 Expect._fail(`${defaultMessage}`); | 149 Expect._fail(`${defaultMessage}`); |
| 179 } | 150 } |
| 180 let left = 0; | 151 let left = 0; |
| 181 let right = 0; | 152 let right = 0; |
| 182 let eLen = expected[dartx.length]; | 153 let eLen = expected[dartx.length]; |
| 183 let aLen = actual[dartx.length]; | 154 let aLen = actual[dartx.length]; |
| 184 while (true) { | 155 while (true) { |
| (...skipping 16 matching lines...) Expand all Loading... |
| 201 let eSnippet = expected[dartx.substring](left, dart.notNull(eLen) - dart.n
otNull(right)); | 172 let eSnippet = expected[dartx.substring](left, dart.notNull(eLen) - dart.n
otNull(right)); |
| 202 let aSnippet = actual[dartx.substring](left, dart.notNull(aLen) - dart.not
Null(right)); | 173 let aSnippet = actual[dartx.substring](left, dart.notNull(aLen) - dart.not
Null(right)); |
| 203 if (dart.notNull(eSnippet[dartx.length]) > 43) { | 174 if (dart.notNull(eSnippet[dartx.length]) > 43) { |
| 204 eSnippet = dart.notNull(eSnippet[dartx.substring](0, 20)) + "..." + dart
.notNull(eSnippet[dartx.substring](dart.notNull(eSnippet[dartx.length]) - 20)); | 175 eSnippet = dart.notNull(eSnippet[dartx.substring](0, 20)) + "..." + dart
.notNull(eSnippet[dartx.substring](dart.notNull(eSnippet[dartx.length]) - 20)); |
| 205 } | 176 } |
| 206 if (dart.notNull(aSnippet[dartx.length]) > 43) { | 177 if (dart.notNull(aSnippet[dartx.length]) > 43) { |
| 207 aSnippet = dart.notNull(aSnippet[dartx.substring](0, 20)) + "..." + dart
.notNull(aSnippet[dartx.substring](dart.notNull(aSnippet[dartx.length]) - 20)); | 178 aSnippet = dart.notNull(aSnippet[dartx.substring](0, 20)) + "..." + dart
.notNull(aSnippet[dartx.substring](dart.notNull(aSnippet[dartx.length]) - 20)); |
| 208 } | 179 } |
| 209 let leftLead = "..."; | 180 let leftLead = "..."; |
| 210 let rightTail = "..."; | 181 let rightTail = "..."; |
| 211 if (dart.notNull(left) <= 10) | 182 if (dart.notNull(left) <= 10) leftLead = ""; |
| 212 leftLead = ""; | 183 if (dart.notNull(right) <= 10) rightTail = ""; |
| 213 if (dart.notNull(right) <= 10) | |
| 214 rightTail = ""; | |
| 215 let diff = `\nDiff (${left}..${dart.notNull(eLen) - dart.notNull(right)}/$
{dart.notNull(aLen) - dart.notNull(right)}):\n` + `${leftLead}${leftSnippet}[ ${
eSnippet} ]${rightSnippet}${rightTail}\n` + `${leftLead}${leftSnippet}[ ${aSnipp
et} ]${rightSnippet}${rightTail}`; | 184 let diff = `\nDiff (${left}..${dart.notNull(eLen) - dart.notNull(right)}/$
{dart.notNull(aLen) - dart.notNull(right)}):\n` + `${leftLead}${leftSnippet}[ ${
eSnippet} ]${rightSnippet}${rightTail}\n` + `${leftLead}${leftSnippet}[ ${aSnipp
et} ]${rightSnippet}${rightTail}`; |
| 216 Expect._fail(`${defaultMessage}${diff}`); | 185 Expect._fail(`${defaultMessage}${diff}`); |
| 217 } | 186 } |
| 218 static setEquals(expected, actual, reason) { | 187 static setEquals(expected, actual, reason) { |
| 219 if (reason === void 0) | 188 if (reason === void 0) reason = null; |
| 220 reason = null; | |
| 221 let missingSet = core.Set.from(expected); | 189 let missingSet = core.Set.from(expected); |
| 222 missingSet.removeAll(actual); | 190 missingSet.removeAll(actual); |
| 223 let extraSet = core.Set.from(actual); | 191 let extraSet = core.Set.from(actual); |
| 224 extraSet.removeAll(expected); | 192 extraSet.removeAll(expected); |
| 225 if (dart.notNull(extraSet.isEmpty) && dart.notNull(missingSet.isEmpty)) | 193 if (dart.notNull(extraSet.isEmpty) && dart.notNull(missingSet.isEmpty)) re
turn; |
| 226 return; | |
| 227 let msg = Expect._getMessage(reason); | 194 let msg = Expect._getMessage(reason); |
| 228 let sb = new core.StringBuffer(`Expect.setEquals(${msg}) fails`); | 195 let sb = new core.StringBuffer(`Expect.setEquals(${msg}) fails`); |
| 229 if (!dart.notNull(missingSet.isEmpty)) { | 196 if (!dart.notNull(missingSet.isEmpty)) { |
| 230 sb.write('\nExpected collection does not contain: '); | 197 sb.write('\nExpected collection does not contain: '); |
| 231 } | 198 } |
| 232 for (let val of missingSet) { | 199 for (let val of missingSet) { |
| 233 sb.write(`${val} `); | 200 sb.write(`${val} `); |
| 234 } | 201 } |
| 235 if (!dart.notNull(extraSet.isEmpty)) { | 202 if (!dart.notNull(extraSet.isEmpty)) { |
| 236 sb.write('\nExpected collection should not contain: '); | 203 sb.write('\nExpected collection should not contain: '); |
| 237 } | 204 } |
| 238 for (let val of extraSet) { | 205 for (let val of extraSet) { |
| 239 sb.write(`${val} `); | 206 sb.write(`${val} `); |
| 240 } | 207 } |
| 241 Expect._fail(dart.toString(sb)); | 208 Expect._fail(dart.toString(sb)); |
| 242 } | 209 } |
| 243 static throws(f, check, reason) { | 210 static throws(f, check, reason) { |
| 244 if (check === void 0) | 211 if (check === void 0) check = null; |
| 245 check = null; | 212 if (reason === void 0) reason = null; |
| 246 if (reason === void 0) | |
| 247 reason = null; | |
| 248 let msg = reason == null ? "" : `(${reason})`; | 213 let msg = reason == null ? "" : `(${reason})`; |
| 249 if (!dart.is(f, _Nullary)) { | 214 if (!dart.is(f, _Nullary)) { |
| 250 Expect._fail(`Expect.throws${msg}: Function f not callable with zero arg
uments`); | 215 Expect._fail(`Expect.throws${msg}: Function f not callable with zero arg
uments`); |
| 251 } | 216 } |
| 252 try { | 217 try { |
| 253 f(); | 218 f(); |
| 254 } catch (e) { | 219 } catch (e) { |
| 255 let s = dart.stackTrace(e); | 220 let s = dart.stackTrace(e); |
| 256 if (check != null) { | 221 if (check != null) { |
| 257 if (!dart.notNull(dart.dcall(check, e))) { | 222 if (!dart.notNull(dart.dcall(check, e))) { |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 dart.setSignature(AssumeDynamic, { | 297 dart.setSignature(AssumeDynamic, { |
| 333 constructors: () => ({AssumeDynamic: [AssumeDynamic, []]}) | 298 constructors: () => ({AssumeDynamic: [AssumeDynamic, []]}) |
| 334 }); | 299 }); |
| 335 // Exports: | 300 // Exports: |
| 336 exports.Expect = Expect; | 301 exports.Expect = Expect; |
| 337 exports.ExpectException = ExpectException; | 302 exports.ExpectException = ExpectException; |
| 338 exports.NoInline = NoInline; | 303 exports.NoInline = NoInline; |
| 339 exports.TrustTypeAnnotations = TrustTypeAnnotations; | 304 exports.TrustTypeAnnotations = TrustTypeAnnotations; |
| 340 exports.AssumeDynamic = AssumeDynamic; | 305 exports.AssumeDynamic = AssumeDynamic; |
| 341 }); | 306 }); |
| OLD | NEW |