flutter/packages/flutter_tools/test/general.shard/base/logs_test.dart

35 lines
882 B
Dart
Raw Normal View History

// Copyright 2014 The Flutter Authors. All rights reserved.
2015-09-29 21:26:42 +00:00
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// @dart = 2.8
import 'package:flutter_tools/src/base/common.dart';
import 'package:flutter_tools/src/cache.dart';
2015-11-10 21:18:34 +00:00
import 'package:flutter_tools/src/commands/logs.dart';
2015-09-29 21:26:42 +00:00
import '../../src/common.dart';
import '../../src/context.dart';
2015-09-29 21:26:42 +00:00
void main() {
2015-09-29 21:26:42 +00:00
group('logs', () {
setUp(() {
Cache.disableLocking();
});
tearDown(() {
Cache.enableLocking();
});
testUsingContext('fail with a bad device id', () async {
final LogsCommand command = LogsCommand();
try {
await createTestCommandRunner(command).run(<String>['-d', 'abc123', 'logs']);
fail('Expect exception');
} on ToolExit catch (e) {
expect(e.exitCode ?? 1, 1);
}
2015-09-29 21:26:42 +00:00
});
});
}