MCPcopy Index your code
hub / github.com/coder/coder / TestMetadataKeyWords

Function TestMetadataKeyWords

coderd/x/chatd/chatloop/contextlimit_internal_test.go:56–77  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54}
55
56func TestMetadataKeyWords(t *testing.T) {
57 t.Parallel()
58
59 tests := []struct {
60 key string
61 want []string
62 }{
63 {"max_context_tokens", []string{"max", "context", "tokens"}},
64 {"maxContextTokens", []string{"max", "context", "tokens"}},
65 {"MAX_CONTEXT", []string{"max", "context"}},
66 {"ContextWindow", []string{"context", "window"}},
67 {"context2limit", []string{"context", "limit"}},
68 {"", []string{}},
69 }
70 for _, tt := range tests {
71 t.Run(tt.key, func(t *testing.T) {
72 t.Parallel()
73 got := metadataKeyWords(tt.key)
74 require.Equal(t, tt.want, got)
75 })
76 }
77}
78
79func TestIsContextLimitKey(t *testing.T) {
80 t.Parallel()

Callers

nothing calls this directly

Calls 3

metadataKeyWordsFunction · 0.85
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected