Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 dart_library.library('expect', null, /* Imports */[ | 1 dart_library.library('expect', null, /* Imports */[ |
| 2 "dart_runtime/dart", | 2 "dart_runtime/dart", |
| 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)) { |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 } | 59 } |
| 60 return null; | 60 return null; |
| 61 } | 61 } |
| 62 static equals(expected, actual, reason) { | 62 static equals(expected, actual, reason) { |
| 63 if (reason === void 0) | 63 if (reason === void 0) |
| 64 reason = null; | 64 reason = null; |
| 65 if (dart.equals(expected, actual)) | 65 if (dart.equals(expected, actual)) |
| 66 return; | 66 return; |
| 67 let msg = Expect._getMessage(reason); | 67 let msg = Expect._getMessage(reason); |
| 68 if (typeof expected == 'string' && typeof actual == 'string') { | 68 if (typeof expected == 'string' && typeof actual == 'string') { |
| 69 let stringDifference = Expect._stringDifference(dart.as(expected, core.S tring), dart.as(actual, core.String)); | 69 let stringDifference = Expect._stringDifference(dart.as(dart.as(dart.as( expected, core.String), core.String), core.String), dart.as(dart.as(dart.as(actu al, core.String), core.String), core.String)); |
|
Jennifer Messerly
2015/07/15 21:45:15
Eeeeep. We appear to be mutating the AST. Investig
Jennifer Messerly
2015/07/15 22:31:35
aha, so this is the problem we knew we were going
| |
| 70 if (stringDifference != null) { | 70 if (stringDifference != null) { |
| 71 Expect._fail(`Expect.equals(${stringDifference}${msg}) fails.`); | 71 Expect._fail(`Expect.equals(${stringDifference}${msg}) fails.`); |
| 72 } | 72 } |
| 73 } | 73 } |
| 74 Expect._fail(`Expect.equals(expected: <${expected}>, actual: <${actual}>${ msg}) fails.`); | 74 Expect._fail(`Expect.equals(expected: <${expected}>, actual: <${actual}>${ msg}) fails.`); |
| 75 } | 75 } |
| 76 static isTrue(actual, reason) { | 76 static isTrue(actual, reason) { |
| 77 if (reason === void 0) | 77 if (reason === void 0) |
| 78 reason = null; | 78 reason = null; |
| 79 if (dart.notNull(_identical(actual, true))) | 79 if (dart.notNull(_identical(actual, true))) |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 332 dart.setSignature(AssumeDynamic, { | 332 dart.setSignature(AssumeDynamic, { |
| 333 constructors: () => ({AssumeDynamic: [AssumeDynamic, []]}) | 333 constructors: () => ({AssumeDynamic: [AssumeDynamic, []]}) |
| 334 }); | 334 }); |
| 335 // Exports: | 335 // Exports: |
| 336 exports.Expect = Expect; | 336 exports.Expect = Expect; |
| 337 exports.ExpectException = ExpectException; | 337 exports.ExpectException = ExpectException; |
| 338 exports.NoInline = NoInline; | 338 exports.NoInline = NoInline; |
| 339 exports.TrustTypeAnnotations = TrustTypeAnnotations; | 339 exports.TrustTypeAnnotations = TrustTypeAnnotations; |
| 340 exports.AssumeDynamic = AssumeDynamic; | 340 exports.AssumeDynamic = AssumeDynamic; |
| 341 }); | 341 }); |
| OLD | NEW |