From 66f52407d3a7f59fd7e2743fe1ccee7ad46df795 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 20 Aug 2025 02:32:22 +0900 Subject: container/initmkdir: check path equivalence by value Fixes regression introduced while integrating Absolute. Signed-off-by: Ophestra --- container/initmkdir_test.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 container/initmkdir_test.go (limited to 'container/initmkdir_test.go') diff --git a/container/initmkdir_test.go b/container/initmkdir_test.go new file mode 100644 index 00000000..89058a85 --- /dev/null +++ b/container/initmkdir_test.go @@ -0,0 +1,23 @@ +package container + +import "testing" + +func TestMkdirOp(t *testing.T) { + checkOpsBuilder(t, []opsBuilderTestCase{ + {"etc", new(Ops).Mkdir(MustAbs("/etc/"), 0), Ops{ + &MkdirOp{Path: MustAbs("/etc/")}, + }}, + }) + + checkOpIs(t, []opIsTestCase{ + {"zero", new(MkdirOp), new(MkdirOp), false}, + {"differs", &MkdirOp{Path: MustAbs("/"), Perm: 0755}, &MkdirOp{Path: MustAbs("/etc/"), Perm: 0755}, false}, + {"equals", &MkdirOp{Path: MustAbs("/")}, &MkdirOp{Path: MustAbs("/")}, true}, + }) + + checkOpMeta(t, []opMetaTestCase{ + {"etc", &MkdirOp{ + Path: MustAbs("/etc/"), + }, "creating", `directory "/etc/" perm ----------`}, + }) +} -- cgit v1.3.1