package mail

import "testing"

func TestAppendMessageAccountScopeRestricted(t *testing.T) {
	base, args, idx := appendMessageAccountScope(
		" FROM messages m WHERE 1=1",
		[]any{"user"},
		2,
		"",
		[]string{"acc-1", "acc-2"},
	)
	if idx != 3 || len(args) != 2 {
		t.Fatalf("idx=%d len(args)=%d", idx, len(args))
	}
	if base == "" || args[1] == nil {
		t.Fatal("expected scoped clause")
	}
}
