package cql

import "testing"

func TestApplyStartupOptionsSetsKeyspace(t *testing.T) {
	conn := &Conn{}
	conn.SetProtocolVersion(ProtoVersion4)

	err := conn.ApplyStartupOptions(map[string]string{
		"KEYSPACE": "TestKeyspace",
	})
	if err != nil {
		t.Fatalf("ApplyStartupOptions failed: %v", err)
	}
	if got := conn.GetKeyspace(); got != "TestKeyspace" {
		t.Fatalf("expected keyspace TestKeyspace, got %q", got)
	}
}
