-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
86 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import 'package:adb/adb.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
void main() { | ||
group( | ||
'AdbForwardList', | ||
() { | ||
test('returns an empty map if adb forward --list output is empty', () { | ||
const output = ''' | ||
'''; | ||
expect(AdbForwardList.parse(output), <String, Map<int, int>>{}); | ||
}); | ||
|
||
test('parses adb forward --list output correctly', () { | ||
const output = ''' | ||
emulator-5554 tcp:60000 tcp:60001 | ||
emulator-5554 tcp:61234 tcp:61235 | ||
emulator-5556 tcp:61341 tcp:62562 | ||
'''; | ||
|
||
final result = AdbForwardList.parse(output); | ||
expect( | ||
result, | ||
{ | ||
'emulator-5554': { | ||
60000: 60001, | ||
61234: 61235, | ||
}, | ||
'emulator-5556': { | ||
61341: 62562, | ||
}, | ||
}, | ||
); | ||
}); | ||
}, | ||
); | ||
} |