aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/autoetc_test.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2025-08-21 00:18:50 +0900
committerOphestra <cat@gensokyo.uk>2025-08-21 00:18:50 +0900
commit5d8a2199b6c8dc5f75b529a39d196c6cb14c98c2 (patch)
tree5ad693466483081342b24df929365490015b4efa /container/autoetc_test.go
parenta1482ecdd0f98728f4b97137cd7b2fa17f67bb89 (diff)
container/init: op interface valid method
Check ops early and eliminate duplicate checks. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'container/autoetc_test.go')
-rw-r--r--container/autoetc_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/container/autoetc_test.go b/container/autoetc_test.go
index 4040fb0d..efb4b3b6 100644
--- a/container/autoetc_test.go
+++ b/container/autoetc_test.go
@@ -3,6 +3,12 @@ package container
import "testing"
func TestAutoEtcOp(t *testing.T) {
+ checkOpsValid(t, []opValidTestCase{
+ {"nil", (*AutoEtcOp)(nil), false},
+ {"zero", new(AutoEtcOp), true},
+ {"populated", &AutoEtcOp{Prefix: ":3"}, true},
+ })
+
checkOpsBuilder(t, []opsBuilderTestCase{
{"pd", new(Ops).Etc(MustAbs("/etc/"), "048090b6ed8f9ebb10e275ff5d8c0659"), Ops{
&MkdirOp{Path: MustAbs("/etc/"), Perm: 0755},