archiver/Globbing_windows_test.go
Christian Schmied 1fa1d47e63
All checks were successful
go/archiver/pipeline/head This commit looks good
slight modification of tests
2024-09-26 11:53:37 +02:00

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)
}
}