All checks were successful
Test / Create distribution (push) Successful in 33s
Test / ShareFS (push) Successful in 39s
Test / Sandbox (push) Successful in 46s
Test / Sandbox (race detector) (push) Successful in 45s
Test / Hpkg (push) Successful in 49s
Test / Hakurei (push) Successful in 54s
Test / Hakurei (race detector) (push) Successful in 55s
Test / Flake checks (push) Successful in 1m35s
This should have been handled in a custom option parsing function, but that much extra complexity is unnecessary for this edge case. Honestly I do not know why libfuse does not handle this itself. Signed-off-by: Ophestra <cat@gensokyo.uk>
30 lines
625 B
Go
30 lines
625 B
Go
package main
|
|
|
|
import (
|
|
"slices"
|
|
"testing"
|
|
)
|
|
|
|
func TestHandleMountArgs(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
testCases := []struct {
|
|
name string
|
|
args []string
|
|
want []string
|
|
}{
|
|
{"nil", nil, nil},
|
|
{"passthrough", []string{"sharefs", "-V"}, []string{"sharefs", "-V"}},
|
|
{"replace", []string{"/sbin/sharefs", "sharefs", "/sdcard", "-o", "rw"}, []string{"sharefs", "/sdcard", "-o", "rw"}},
|
|
}
|
|
for _, tc := range testCases {
|
|
t.Run(tc.name, func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
if got := handleMountArgs(tc.args); !slices.Equal(got, tc.want) {
|
|
t.Errorf("handleMountArgs: %q, want %q", got, tc.want)
|
|
}
|
|
})
|
|
}
|
|
}
|