mirror of
https://github.com/taigrr/adb.git
synced 2026-04-02 02:58:42 -07:00
add more unit tests to parseDevices
This commit is contained in:
21
adb_test.go
21
adb_test.go
@@ -15,6 +15,27 @@ func Test_parseDevices(t *testing.T) {
|
||||
want []Device
|
||||
wantErr bool
|
||||
}{
|
||||
{
|
||||
name: "no devices", args: args{stdout: `List of devices attached`},
|
||||
wantErr: false,
|
||||
want: []Device{},
|
||||
},
|
||||
{
|
||||
name: "1 auth dev", args: args{stdout: `List of devices attached
|
||||
19291FDEE0023W device`},
|
||||
wantErr: false,
|
||||
want: []Device{
|
||||
{IsAuthorized: true, SerialNo: "19291FDEE0023W"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "1 unauth dev", args: args{stdout: `List of devices attached
|
||||
HT75R0202681 unauthorized`},
|
||||
wantErr: false,
|
||||
want: []Device{
|
||||
{IsAuthorized: false, SerialNo: "HT75R0202681"},
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "2 auth 1 unauth", args: args{stdout: `List of devices attached
|
||||
19291FDEE0023W device
|
||||
|
||||
Reference in New Issue
Block a user