viye/internal/plumbing/gobin/gobin_test.go (view raw)
Oleksandr Smirnov
Oleksandr Smirnov
olexsmir@gmail.com use olexsmir.xyz/x/is for asserts; test missing plumbings, 2 months ago
olexsmir@gmail.com use olexsmir.xyz/x/is for asserts; test missing plumbings, 2 months ago
| 1 | package gobin |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/olexsmir/viye/internal/viye" |
| 7 | |
| 8 | "olexsmir.xyz/x/is" |
| 9 | ) |
| 10 | |
| 11 | func TestMatch(t *testing.T) { |
| 12 | tests := []struct { |
| 13 | path []string |
| 14 | want bool |
| 15 | }{ |
| 16 | {[]string{"go"}, true}, |
| 17 | {[]string{"go", "build"}, true}, |
| 18 | {[]string{"go", "test", "./..."}, true}, |
| 19 | {[]string{"other"}, false}, |
| 20 | {[]string{}, false}, |
| 21 | } |
| 22 | for _, tt := range tests { |
| 23 | got := (Tool{}).Match(&viye.Context{Path: tt.path}) |
| 24 | is.Equal(t, tt.want, got) |
| 25 | } |
| 26 | } |
| 27 | |
| 28 | func TestExecute(t *testing.T) { |
| 29 | t.Skipf("TODO implement") |
| 30 | } |