Files
sdk/pkg/dartdev/test/sdk_test.dart
T
Devon Carew 504195907b [dartdev] don't expose the 'dart migrate' command on the stable channel
Change-Id: I95d5d9dd74e488c749f17fd358d20188de32866c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160184
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Jaime Wren <jwren@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-08-26 17:42:55 +00:00

55 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 'package:dartdev/src/sdk.dart';
import 'package:test/test.dart';
void main() {
group('Sdk', _sdk);
group('Runtime', _runtime);
}
void _sdk() {
test('sdkPath', () {
expectDirectoryExists(Sdk().sdkPath);
});
test('dart binary', () {
expectFileExists(Sdk().dart);
});
test('analysis_server snapshot', () {
expectFileExists(Sdk().analysisServerSnapshot);
});
test('pub snapshot', () {
expectFileExists(Sdk().pubSnapshot);
});
test('dds snapshot', () {
expectFileExists(Sdk().ddsSnapshot);
});
test('dart2js snapshot', () {
expectFileExists(Sdk().dart2jsSnapshot);
});
}
void _runtime() {
test('channel', () {
final runtime = Runtime.runtime;
expect(runtime.channel, isNotEmpty);
});
}
void expectFileExists(String path) {
expect(File(path).existsSync(), isTrue);
}
void expectDirectoryExists(String path) {
expect(Directory(path).existsSync(), isTrue);
}