From 5d8a2199b6c8dc5f75b529a39d196c6cb14c98c2 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Thu, 21 Aug 2025 00:18:50 +0900 Subject: container/init: op interface valid method Check ops early and eliminate duplicate checks. Signed-off-by: Ophestra --- container/initdev_test.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'container/initdev_test.go') diff --git a/container/initdev_test.go b/container/initdev_test.go index 0d6ea5af..4e23e6ba 100644 --- a/container/initdev_test.go +++ b/container/initdev_test.go @@ -3,6 +3,12 @@ package container import "testing" func TestMountDevOp(t *testing.T) { + checkOpsValid(t, []opValidTestCase{ + {"nil", (*MountDevOp)(nil), false}, + {"zero", new(MountDevOp), false}, + {"valid", &MountDevOp{Target: MustAbs("/dev/")}, true}, + }) + checkOpsBuilder(t, []opsBuilderTestCase{ {"dev", new(Ops).Dev(MustAbs("/dev/"), true), Ops{ &MountDevOp{ -- cgit v1.3.1