File: error_test.go

package info (click to toggle)
fdroidcl 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,828 kB
  • sloc: makefile: 3
file content (23 lines) | stat: -rw-r--r-- 478 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright (c) 2015, Daniel Martí <mvdan@mvdan.cc>
// See LICENSE for licensing information

package adb

import "testing"

func TestParseError(t *testing.T) {
	tests := []struct {
		in   string
		want error
	}{
		{"FAILED_DEXOPT", ErrDexopt},
		{"PARSE_FAILED_NOT_APK", ErrNotApk},
		{"FAILED_ABORTED", ErrAborted},
	}
	for _, c := range tests {
		got := parseError(c.in)
		if got != c.want {
			t.Fatalf("Parse error in %s - wanted %v, got %v", c.in, c.want, got)
		}
	}
}