Skip to content

Commit

Permalink
more coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesWoolfenden committed Sep 21, 2023
1 parent 1edf763 commit d472efa
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ provider.azure.tf
*.js
*.zip
arm/test-output/
src/arm/test-output/
src/arm/test-output/
src/arm/nowhere/
1 change: 1 addition & 0 deletions src/arm/data_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func Test_parseData(t *testing.T) {
{"emptyData", args{emptyData, funcMap, "test-output"}, false},
{"data", args{results, funcMap, "test-output"}, false},
{"bad funk", args{results, badFunk, "test-output"}, true},
{"bad destination", args{results, funcMap, "/usr/bin/nowhere"}, true},
}

for _, tt := range tests {
Expand Down
23 changes: 23 additions & 0 deletions src/cf/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -604,3 +604,26 @@ func TestMap(t *testing.T) {
})
}
}

func TestSplitOn1(t *testing.T) {
type args struct {
source string
separator string
index int
}
tests := []struct {
name string
args args
want string
}{
{"Pass", args{"Fab Five Freddy told me everybody's fly", "me", 0}, "Fab Five Freddy told "},
{"Nought", args{"Fab Five Freddy told me everybody's fly", "aardvark", 1}, ""},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
if got := sato.SplitOn(tt.args.source, tt.args.separator, tt.args.index); got != tt.want {
t.Errorf("SplitOn() = %v, want %v", got, tt.want)
}
})
}
}
3 changes: 2 additions & 1 deletion src/cf/parse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ func TestWrite(t *testing.T) {
args args
wantErr bool
}{
//{},
{"Pass", args{"gibberine", ".", "test"}, false},
{"Fail", args{"gibberine", "/usr/bin/local", "test"}, true},
}

for _, tt := range tests {
Expand Down

0 comments on commit d472efa

Please sign in to comment.