From 562f5ed7971603a4e4e3315a7fe4188153bfc205 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Wed, 15 Jan 2025 10:07:51 +0900 Subject: fst: hide sockets exposed via Filesystem This is mostly useful for permissive defaults. Signed-off-by: Ophestra --- internal/app/app_test.go | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'internal/app/app_test.go') diff --git a/internal/app/app_test.go b/internal/app/app_test.go index a8fd761e..25691ffe 100644 --- a/internal/app/app_test.go +++ b/internal/app/app_test.go @@ -1,6 +1,7 @@ package app_test import ( + "encoding/json" "io/fs" "reflect" "testing" @@ -48,14 +49,22 @@ func TestApp(t *testing.T) { t.Run("compare bwrap", func(t *testing.T) { if !reflect.DeepEqual(gotBwrap, tc.wantBwrap) { - t.Errorf("seal: bwrap = %#v, want %#v", - gotBwrap, tc.wantBwrap) + t.Errorf("seal: bwrap =\n%s\n, want\n%s", + mustMarshal(gotBwrap), mustMarshal(tc.wantBwrap)) } }) }) } } +func mustMarshal(v any) string { + if b, err := json.Marshal(v); err != nil { + panic(err.Error()) + } else { + return string(b) + } +} + func stubDirEntries(names ...string) (e []fs.DirEntry, err error) { e = make([]fs.DirEntry, len(names)) for i, name := range names { -- cgit v1.3.1