container/check: move absolute pathname
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Hpkg (push) Successful in 4m3s
Test / Sandbox (race detector) (push) Successful in 4m26s
Test / Hakurei (race detector) (push) Successful in 5m19s
Test / Sandbox (push) Successful in 1m28s
Test / Hakurei (push) Successful in 2m16s
Test / Flake checks (push) Successful in 1m37s
All checks were successful
Test / Create distribution (push) Successful in 34s
Test / Hpkg (push) Successful in 4m3s
Test / Sandbox (race detector) (push) Successful in 4m26s
Test / Hakurei (race detector) (push) Successful in 5m19s
Test / Sandbox (push) Successful in 1m28s
Test / Hakurei (push) Successful in 2m16s
Test / Flake checks (push) Successful in 1m37s
This allows use of absolute pathname values without importing container. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"testing"
|
||||
|
||||
"hakurei.app/container"
|
||||
"hakurei.app/container/check"
|
||||
"hakurei.app/hst"
|
||||
)
|
||||
|
||||
@@ -216,11 +217,11 @@ type stubFS struct {
|
||||
typeName string
|
||||
}
|
||||
|
||||
func (s stubFS) Valid() bool { return false }
|
||||
func (s stubFS) Path() *container.Absolute { panic("unreachable") }
|
||||
func (s stubFS) Host() []*container.Absolute { panic("unreachable") }
|
||||
func (s stubFS) Apply(*hst.ApplyState) { panic("unreachable") }
|
||||
func (s stubFS) String() string { return "<invalid " + s.typeName + ">" }
|
||||
func (s stubFS) Valid() bool { return false }
|
||||
func (s stubFS) Path() *check.Absolute { panic("unreachable") }
|
||||
func (s stubFS) Host() []*check.Absolute { panic("unreachable") }
|
||||
func (s stubFS) Apply(*hst.ApplyState) { panic("unreachable") }
|
||||
func (s stubFS) String() string { return "<invalid " + s.typeName + ">" }
|
||||
|
||||
type sCheck struct {
|
||||
FS hst.FilesystemConfigJSON `json:"fs"`
|
||||
@@ -232,8 +233,8 @@ type fsTestCase struct {
|
||||
fs hst.FilesystemConfig
|
||||
valid bool
|
||||
ops container.Ops
|
||||
path *container.Absolute
|
||||
host []*container.Absolute
|
||||
path *check.Absolute
|
||||
host []*check.Absolute
|
||||
str string
|
||||
}
|
||||
|
||||
@@ -287,11 +288,11 @@ func checkFs(t *testing.T, testCases []fsTestCase) {
|
||||
}
|
||||
}
|
||||
|
||||
func m(pathname string) *container.Absolute { return container.MustAbs(pathname) }
|
||||
func ms(pathnames ...string) []*container.Absolute {
|
||||
as := make([]*container.Absolute, len(pathnames))
|
||||
func m(pathname string) *check.Absolute { return check.MustAbs(pathname) }
|
||||
func ms(pathnames ...string) []*check.Absolute {
|
||||
as := make([]*check.Absolute, len(pathnames))
|
||||
for i, pathname := range pathnames {
|
||||
as[i] = container.MustAbs(pathname)
|
||||
as[i] = check.MustAbs(pathname)
|
||||
}
|
||||
return as
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user