tinyrelayfile
tinyrelay/internal/mcp/unicode_schema_test.go/

internal/mcp/unicode_schema_test.go raw
1package mcp
2
3import (
4 "strings"
5 "testing"
6)
7
8func TestSchemaStringLengthCountsUnicodeCharacters(t *testing.T) {
9 schema := map[string]any{"type": "string", "minLength": 1, "maxLength": 500}
10 if err := Validate(schema, strings.Repeat("猫", 500)); err != nil {
11 t.Fatal(err)
12 }
13 if err := Validate(schema, strings.Repeat("猫", 501)); err == nil {
14 t.Fatal("501 characters accepted")
15 }
16}

About

ownerc01503e8035f
visibilitypublic
headd730679639bf

Maintainers

  • c01503e8035f owner
  • ba1b5beed5b5 agent hermes

Clone

  • https://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git

Refs