diff options
| author | Ophestra <cat@gensokyo.uk> | 2025-08-21 00:18:50 +0900 |
|---|---|---|
| committer | Ophestra <cat@gensokyo.uk> | 2025-08-21 00:18:50 +0900 |
| commit | 5d8a2199b6c8dc5f75b529a39d196c6cb14c98c2 (patch) | |
| tree | 5ad693466483081342b24df929365490015b4efa /container/initbind_test.go | |
| parent | a1482ecdd0f98728f4b97137cd7b2fa17f67bb89 (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/initbind_test.go')
| -rw-r--r-- | container/initbind_test.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/container/initbind_test.go b/container/initbind_test.go index f0792613..bae33f8a 100644 --- a/container/initbind_test.go +++ b/container/initbind_test.go @@ -3,6 +3,14 @@ package container import "testing" func TestBindMountOp(t *testing.T) { + checkOpsValid(t, []opValidTestCase{ + {"nil", (*BindMountOp)(nil), false}, + {"zero", new(BindMountOp), false}, + {"nil source", &BindMountOp{Target: MustAbs("/")}, false}, + {"nil target", &BindMountOp{Source: MustAbs("/")}, false}, + {"valid", &BindMountOp{Source: MustAbs("/"), Target: MustAbs("/")}, true}, + }) + checkOpsBuilder(t, []opsBuilderTestCase{ {"autoetc", new(Ops).Bind( MustAbs("/etc/"), |
