mirror of
https://github.com/thegeeklab/wp-docker-buildx.git
synced 2024-11-13 22:50:41 +00:00
26 lines
402 B
Go
26 lines
402 B
Go
|
package docker
|
||
|
|
||
|
import "testing"
|
||
|
|
||
|
func Test_stripHeadPrefix(t *testing.T) {
|
||
|
type args struct {
|
||
|
ref string
|
||
|
}
|
||
|
tests := []struct {
|
||
|
args args
|
||
|
want string
|
||
|
}{
|
||
|
{
|
||
|
args: args{
|
||
|
ref: "refs/heads/master",
|
||
|
},
|
||
|
want: "master",
|
||
|
},
|
||
|
}
|
||
|
for _, tt := range tests {
|
||
|
if got := stripHeadPrefix(tt.args.ref); got != tt.want {
|
||
|
t.Errorf("stripHeadPrefix() = %v, want %v", got, tt.want)
|
||
|
}
|
||
|
}
|
||
|
}
|