Ian Hickson | 449f4a6 | 2019-11-27 15:04:02 -0800 | [diff] [blame] | 1 | // Copyright 2014 The Flutter Authors. All rights reserved. |
Ian Fischer | 6a5fe19 | 2015-09-29 14:26:42 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Dan Rubel | e384c0d | 2016-11-13 22:09:03 -0500 | [diff] [blame] | 5 | import 'package:flutter_tools/src/base/common.dart'; |
Adam Barth | da0a12c | 2015-11-10 13:18:34 -0800 | [diff] [blame] | 6 | import 'package:flutter_tools/src/commands/logs.dart'; |
Ian Fischer | 6a5fe19 | 2015-09-29 14:26:42 -0700 | [diff] [blame] | 7 | |
Ian Hickson | d919e69 | 2019-07-13 11:51:44 -0700 | [diff] [blame] | 8 | import '../../src/common.dart'; |
| 9 | import '../../src/context.dart'; |
| 10 | import '../../src/mocks.dart'; |
Ian Fischer | 6a5fe19 | 2015-09-29 14:26:42 -0700 | [diff] [blame] | 11 | |
Hixie | c7339de | 2016-03-09 17:43:14 -0800 | [diff] [blame] | 12 | void main() { |
Ian Fischer | 6a5fe19 | 2015-09-29 14:26:42 -0700 | [diff] [blame] | 13 | group('logs', () { |
Dan Rubel | e384c0d | 2016-11-13 22:09:03 -0500 | [diff] [blame] | 14 | testUsingContext('fail with a bad device id', () async { |
Alexandre Ardhuin | d927c93 | 2018-09-12 08:29:29 +0200 | [diff] [blame] | 15 | final LogsCommand command = LogsCommand(); |
Adam Barth | bdd2066 | 2015-10-11 19:42:50 -0700 | [diff] [blame] | 16 | applyMocksToCommand(command); |
Dan Rubel | e384c0d | 2016-11-13 22:09:03 -0500 | [diff] [blame] | 17 | try { |
| 18 | await createTestCommandRunner(command).run(<String>['-d', 'abc123', 'logs']); |
| 19 | fail('Expect exception'); |
| 20 | } on ToolExit catch (e) { |
| 21 | expect(e.exitCode ?? 1, 1); |
| 22 | } |
Ian Fischer | 6a5fe19 | 2015-09-29 14:26:42 -0700 | [diff] [blame] | 23 | }); |
| 24 | }); |
| 25 | } |