aboutsummaryrefslogtreecommitdiffhomepage
path: root/container/mount_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/mount_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/mount_test.go')
-rw-r--r--container/mount_test.go18
1 files changed, 18 insertions, 0 deletions
diff --git a/container/mount_test.go b/container/mount_test.go
index 4c598b3f..64cac282 100644
--- a/container/mount_test.go
+++ b/container/mount_test.go
@@ -49,6 +49,24 @@ func TestEscapeOverlayDataSegment(t *testing.T) {
}
}
+type opValidTestCase struct {
+ name string
+ op Op
+ want bool
+}
+
+func checkOpsValid(t *testing.T, testCases []opValidTestCase) {
+ t.Run("valid", func(t *testing.T) {
+ for _, tc := range testCases {
+ t.Run(tc.name, func(t *testing.T) {
+ if got := tc.op.Valid(); got != tc.want {
+ t.Errorf("Valid: %v, want %v", got, tc.want)
+ }
+ })
+ }
+ })
+}
+
type opsBuilderTestCase struct {
name string
ops *Ops