OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 import 'package:scheduled_test/scheduled_test.dart'; |
| 6 |
| 7 import '../descriptor.dart' as d; |
| 8 import '../test_pub.dart'; |
| 9 |
| 10 main() { |
| 11 initConfig(); |
| 12 |
| 13 // This test is a bit shaky. Since dart2js is free to inline things, it's |
| 14 // not precise as to which source libraries will actually be referenced in |
| 15 // the source map. But this tries to use a type in the core library |
| 16 // (StringBuffer) and validate that its source ends up in the source map. |
| 17 integration("Dart core libraries are available to source maps", () { |
| 18 d.dir( |
| 19 appPath, |
| 20 [ |
| 21 d.appPubspec(), |
| 22 d.dir( |
| 23 "web", |
| 24 [ |
| 25 d.file("main.dart", "main() => new StringBuffer().writeAll([
's']);"), |
| 26 d.dir( |
| 27 "sub", |
| 28 [ |
| 29 d.file( |
| 30 "main.dart", |
| 31 "main() => new StringBuffer().writeAll(['s']);")
])])]).create(); |
| 32 |
| 33 schedulePub( |
| 34 args: ["build", "--mode", "debug"], |
| 35 output: new RegExp(r'Built \d+ files to "build".'), |
| 36 exitCode: 0); |
| 37 |
| 38 d.dir( |
| 39 appPath, |
| 40 [ |
| 41 d.dir( |
| 42 "build", |
| 43 [ |
| 44 d.dir( |
| 45 "web", |
| 46 [ |
| 47 d.matcherFile( |
| 48 "main.dart.js.map", |
| 49 contains(r"packages/$sdk/lib/core/string_buffer.
dart")), |
| 50 d.dir( |
| 51 "sub", |
| 52 [ |
| 53 d.matcherFile( |
| 54 "main.dart.js.map", |
| 55 contains(r"../packages/$sdk/lib/core/str
ing_buffer.dart"))]), |
| 56 d.dir( |
| 57 "packages", |
| 58 [ |
| 59 d.dir( |
| 60 r"$sdk", |
| 61 [ |
| 62 d.dir( |
| 63 "lib", |
| 64 [ |
| 65 d.dir( |
| 66 r"core", |
| 67 [ |
| 68 d.matcherFile( |
| 69 "string_buffer.d
art", |
| 70 contains("class
StringBuffer"))])])])])])])]).validate(); |
| 71 }); |
| 72 } |
OLD | NEW |