dart-sdk/pkg/js_runtime/test/in_sync_test.dart
Nicholas Shahan 4fc7567c22 [web] Cleanup redundant language version comments
- Files in the SDK are already opted into null safety.
- Files in the packages are already opted into null safety via
  the pubspecs.
- in_sync_test.dart was opted out but required no changes to
  migrate.

Change-Id: Ic9334824de1b22c879e962f488e1fa8021017710
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/246058
Reviewed-by: Mayank Patke <fishythefish@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2022-05-26 20:19:09 +00:00

37 lines
1.4 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.
/// Test to verify that this package is in-sync with dart2js runtime libraries.
import 'dart:io';
import 'package:_fe_analyzer_shared/src/util/relativize.dart';
import 'package:expect/expect.dart';
void main(List<String> argv) {
var packageDir = Platform.script.resolve('../lib/synced/');
var sdkDir = Platform.script
.resolve('../../../sdk/lib/_internal/js_runtime/lib/synced/');
var rPackageDir =
relativizeUri(Directory.current.uri, packageDir, Platform.isWindows);
var rSdkDir =
relativizeUri(Directory.current.uri, sdkDir, Platform.isWindows);
for (var file in Directory.fromUri(sdkDir).listSync()) {
if (file is File) {
var filename = file.uri.pathSegments.last;
var packageFile = File.fromUri(packageDir.resolve(filename));
Expect.isTrue(
packageFile.existsSync(),
"$filename not in sync. Please update it by running:\n"
" cp $rSdkDir$filename $rPackageDir$filename");
var original = file.readAsBytesSync();
var copy = packageFile.readAsBytesSync();
Expect.listEquals(
original,
copy,
"$filename not in sync. Please update it by running:\n"
" cp $rSdkDir$filename $rPackageDir$filename");
}
}
}