diff options
| author | Ophestra Umiker <cat@ophivana.moe> | 2024-10-27 11:56:20 +0900 |
|---|---|---|
| committer | Ophestra Umiker <cat@ophivana.moe> | 2024-10-27 12:09:34 +0900 |
| commit | 51e84ba8a52bcd06f544ace45f3fecb9396881ab (patch) | |
| tree | 7ee4950a0eea0867a7380b4eeabc3ff00bea8c02 /internal/app/app_test.go | |
| parent | 7df9d8d01dadcb05396d278aba11afc2ab4a2328 (diff) | |
system/dbus: compare sealed value by string
Stringer method of dbus.Proxy returns a string representation of its args stream when sealed.
Signed-off-by: Ophestra Umiker <cat@ophivana.moe>
Diffstat (limited to 'internal/app/app_test.go')
| -rw-r--r-- | internal/app/app_test.go | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/internal/app/app_test.go b/internal/app/app_test.go index 2d7958b6..fd223afb 100644 --- a/internal/app/app_test.go +++ b/internal/app/app_test.go @@ -4,6 +4,7 @@ import ( "io/fs" "reflect" "testing" + "time" "git.ophivana.moe/security/fortify/helper/bwrap" "git.ophivana.moe/security/fortify/internal" @@ -79,3 +80,55 @@ func (p stubDirEntryPath) Type() fs.FileMode { func (p stubDirEntryPath) Info() (fs.FileInfo, error) { panic("attempted to call Info") } + +type stubFileInfoMode fs.FileMode + +func (s stubFileInfoMode) Name() string { + panic("attempted to call Name") +} + +func (s stubFileInfoMode) Size() int64 { + panic("attempted to call Size") +} + +func (s stubFileInfoMode) Mode() fs.FileMode { + return fs.FileMode(s) +} + +func (s stubFileInfoMode) ModTime() time.Time { + panic("attempted to call ModTime") +} + +func (s stubFileInfoMode) IsDir() bool { + panic("attempted to call IsDir") +} + +func (s stubFileInfoMode) Sys() any { + panic("attempted to call Sys") +} + +type stubFileInfoIsDir bool + +func (s stubFileInfoIsDir) Name() string { + panic("attempted to call Name") +} + +func (s stubFileInfoIsDir) Size() int64 { + panic("attempted to call Size") +} + +func (s stubFileInfoIsDir) Mode() fs.FileMode { + panic("attempted to call Mode") +} + +func (s stubFileInfoIsDir) ModTime() time.Time { + panic("attempted to call ModTime") +} + +func (s stubFileInfoIsDir) IsDir() bool { + return bool(s) +} + +func (s stubFileInfoIsDir) Sys() any { + panic("attempted to call Sys") +} |
