package roomid

import "testing"

// TestValidStringID verifies the converged room_id subset accepted by IM and RTC.
func TestValidStringID(t *testing.T) {
	tests := []struct {
		name  string
		value string
		want  bool
	}{
		{name: "ascii", value: "room_1001-A", want: true},
		{name: "numeric_string", value: "123", want: true},
		{name: "empty", value: "", want: false},
		{name: "space", value: "room 1001", want: false},
		{name: "colon", value: "room:1001", want: false},
		{name: "unicode", value: "房间1", want: false},
		{name: "too_long", value: "room_12345678901234567890123456789012345678901234", want: false},
	}

	for _, test := range tests {
		t.Run(test.name, func(t *testing.T) {
			if got := ValidStringID(test.value); got != test.want {
				t.Fatalf("ValidStringID(%q)=%v want %v", test.value, got, test.want)
			}
		})
	}
}
