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