58969783ba
Change-Id: I84e89d2c5404949a5b4aa27c17ea793a5cc92531 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/208480 Commit-Queue: Jaime Wren <jwren@google.com> Reviewed-by: Ben Konyi <bkonyi@google.com> Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
45 lines
1.2 KiB
Dart
45 lines
1.2 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' as io;
|
|
|
|
import 'package:cli_util/cli_logging.dart';
|
|
import 'package:dartdev/src/analysis_server.dart';
|
|
import 'package:dartdev/src/core.dart';
|
|
import 'package:dartdev/src/sdk.dart';
|
|
import 'package:test/test.dart';
|
|
|
|
import 'utils.dart';
|
|
|
|
void main() {
|
|
group('AnalysisServer', () {
|
|
TestProject p;
|
|
|
|
setUp(() {
|
|
log = Logger.standard();
|
|
p = project();
|
|
});
|
|
|
|
tearDown(() => p?.dispose());
|
|
|
|
test('can start', () async {
|
|
AnalysisServer server = AnalysisServer(io.Directory(sdk.sdkPath), [p.dir],
|
|
commandName: 'testing', argResults: null);
|
|
await server.start();
|
|
await server.shutdown();
|
|
});
|
|
|
|
test('can send message', () async {
|
|
AnalysisServer server = AnalysisServer(io.Directory(sdk.sdkPath), [p.dir],
|
|
commandName: 'testing', argResults: null);
|
|
await server.start();
|
|
|
|
final response = await server.getVersion();
|
|
expect(response, isNotEmpty);
|
|
|
|
await server.shutdown();
|
|
});
|
|
});
|
|
}
|