forked from project-dalec/dalec
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtests_test.go
More file actions
33 lines (28 loc) · 788 Bytes
/
Copy pathtests_test.go
File metadata and controls
33 lines (28 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package dalec
import (
"testing"
"github.com/moby/buildkit/client/llb"
)
func TestCheckOutputGetSourceLocationProgrammaticSlices(t *testing.T) {
t.Parallel()
state := llb.Scratch()
check := CheckOutput{
Contains: []string{"foo"},
Matches: []string{"bar"},
}
for _, tc := range []struct {
kind string
index int
}{
{kind: CheckOutputContainsKind, index: 0},
{kind: CheckOutputContainsKind, index: 1},
{kind: CheckOutputContainsKind, index: -1},
{kind: CheckOutputMatchesKind, index: 0},
{kind: CheckOutputMatchesKind, index: 1},
{kind: CheckOutputMatchesKind, index: -1},
} {
if loc := check.GetSourceLocation(state, tc.kind, tc.index); loc != nil {
t.Fatalf("expected nil source location for %s index %d, got %#v", tc.kind, tc.index, loc)
}
}
}