Files
sdk/tests/lib/isolate/nnbd_spawnuri_autodetect_3_test.dart
T
asiva 308c8059f3 [Tests] - Fix the spawnuri autodetect tests.
TESTS = existing tests are being fixed here

Change-Id: I9136017d29c11f73dd97c82364dc5ead8e2ae7d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/169407
Reviewed-by: Alexander Aprelev <aam@google.com>
Commit-Queue: Siva Annamalai <asiva@google.com>
2020-11-04 17:50:27 +00:00

33 lines
1.1 KiB
Dart

// Copyright (c) 2020, 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 "nnbd_spawnuri_autodetect_helper.dart";
void main() {
// Create temporary directory.
var tmpDir = Directory.systemTemp.createTempSync();
var tmpDirPath = tmpDir.path;
String sourcePath = "$tmpDirPath/strong_isolate.dart";
String outPath = "$tmpDirPath/strong_isolate.dill";
// Generate code for an isolate to run in strong mode.
generateIsolateSource(sourcePath, "");
generateKernel(sourcePath, outPath);
try {
String outUri = Uri.file(outPath).toString();
// Strong Isolate Spawning another Strong Isolate using spawnUri.
testNullSafetyMode(
"$tmpDirPath/strong_strong.dart", "", outUri, 're: strong');
// Weak Isolate Spawning a Strong Isolate using spawnUri.
testNullSafetyMode(
"$tmpDirPath/weak_strong.dart", "2.6", outUri, 're: strong');
} finally {
tmpDir.deleteSync(recursive: true);
}
}