Christian Schmied
1fa1d47e63
All checks were successful
go/archiver/pipeline/head This commit looks good
21 lines
504 B
Go
21 lines
504 B
Go
package archiver
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func TestGetGlobRoot(t *testing.T) {
|
|
assertThat(t, getGlobRoot("C:\\foo\\bar\\baz"), "C:\\foo\\bar\\baz")
|
|
|
|
assertThat(t, getGlobRoot("C:\\foo\\bar\\*\\baz"), "C:\\foo\\bar")
|
|
assertThat(t, getGlobRoot("C:\\foo\\bar\\*"), "C:\\foo\\bar")
|
|
|
|
assertThat(t, getGlobRoot("foo\\bar\\*"), "foo\\bar")
|
|
}
|
|
|
|
func assertThat[E comparable](t *testing.T, actual E, expected E) {
|
|
t.Helper()
|
|
if actual != expected {
|
|
t.Errorf("actual %v, expected %v", actual, expected)
|
|
}
|
|
}
|