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)
			}
		})
	}
}
