blob: 84e603846bb32f042c04705791da4ad98bc64c20 [file] [log] [blame]
// 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.
// @dart = 2.9
import 'dart:io';
import 'package:expect/expect.dart';
import 'package:path/path.dart' as p;
import 'package:source_maps/source_maps.dart' as sm;
void main() async {
final binDir = p.dirname(Platform.resolvedExecutable);
final sdkDir = p.dirname(binDir);
// This test expects to run in a build SDK.
final sdkJsMapDir =
p.joinAll([sdkDir, 'lib', 'dev_compiler', 'kernel', 'amd']);
final sdkJsMapFile = p.join(sdkJsMapDir, '');
final sdkJsMapText = await File(sdkJsMapFile).readAsString();
var mapping = sm.parse(sdkJsMapText) as sm.SingleMapping;
var urls = mapping.urls;
for (var url in urls) {
Expect.equals(p.extension(url), '.dart');
var fullPath = p.canonicalize(p.join(sdkJsMapDir, url));
Expect.isTrue(await File(fullPath).exists(), 'Missing file: $fullPath');