b59923de58
Bug: https://github.com/dart-lang/sdk/issues/31587 Change-Id: I9fc7d83aab68ee2b30d71f8a3a75b74fa4dde55e Reviewed-on: https://dart-review.googlesource.com/30390 Commit-Queue: Ryan Macnak <rmacnak@google.com> Reviewed-by: Siva Annamalai <asiva@google.com>
43 lines
1.2 KiB
Dart
43 lines
1.2 KiB
Dart
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
library field_script_test;
|
|
|
|
import 'package:observatory/service_io.dart';
|
|
import 'package:unittest/unittest.dart';
|
|
import 'test_helper.dart';
|
|
import 'service_test_common.dart';
|
|
|
|
part 'field_script_other.dart';
|
|
|
|
code() {
|
|
print(otherField);
|
|
}
|
|
|
|
var tests = <IsolateTest>[
|
|
hasPausedAtStart,
|
|
(Isolate isolate) async {
|
|
Library lib = await isolate.rootLibrary.load();
|
|
var fields = lib.variables;
|
|
expect(fields.length, 2);
|
|
print(lib.variables);
|
|
for (Field f in fields) {
|
|
await f.load();
|
|
String locationString = await f.location.toUserString();
|
|
if (f.name == "tests") {
|
|
expect(locationString, "field_script_test.dart:18:5");
|
|
} else if (f.name == "otherField") {
|
|
expect(locationString, "field_script_other.dart:7:5");
|
|
} else {
|
|
fail("Unexpected field: ${f.name}");
|
|
}
|
|
}
|
|
}
|
|
];
|
|
|
|
main(args) {
|
|
runIsolateTestsSynchronous(args, tests,
|
|
testeeConcurrent: code, pause_on_start: true, pause_on_exit: true);
|
|
}
|