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/initplace_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/initplace_test.go')
| -rw-r--r-- | container/initplace_test.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/container/initplace_test.go b/container/initplace_test.go index e1d8163d..db3d955c 100644 --- a/container/initplace_test.go +++ b/container/initplace_test.go @@ -3,6 +3,12 @@ package container import "testing" func TestTmpfileOp(t *testing.T) { + checkOpsValid(t, []opValidTestCase{ + {"nil", (*TmpfileOp)(nil), false}, + {"zero", new(TmpfileOp), false}, + {"valid", &TmpfileOp{Path: MustAbs("/etc/passwd")}, true}, + }) + checkOpsBuilder(t, []opsBuilderTestCase{ {"noref", new(Ops).Place(MustAbs("/etc/passwd"), []byte(`chronos:x:65534:65534:Hakurei:/var/empty:/bin/zsh`)), Ops{ &TmpfileOp{ |
