dart-sdk/pkg/modular_test/test/find_sdk_root1_test.dart
Sigmund Cherem 0a3ca5a098 [modular_test]: support running modular_test unit tests in shards.
The findRoot method made assumptions that were only true when running the
test in the main shard of our test runners. This caused a few tests to
start failing when sharding was enabled in:
089364baab

Fixes #53059

Change-Id: I32c59d6ae396fba5cbf19491eb17d7b90a7b8cd9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/316642
Reviewed-by: Srujan Gaddam <srujzs@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2023-07-27 19:19:43 +00:00

18 lines
642 B
Dart

// Copyright (c) 2019, 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.
import 'dart:io';
import 'package:expect/expect.dart';
import 'package:async_helper/async_helper.dart';
import 'package:modular_test/src/find_sdk_root.dart';
// This and the 'src/find_sdk_root2_test.dart' check that we can locate
// the SDK root properly regardless of the location of the `Platform.script`.
main() {
asyncTest(() async {
Expect.equals(Platform.script.resolve("../../../"), await findRoot());
});
}