MCPcopy Index your code
hub / github.com/codehamr/codehamr / TestTokensHeuristic

Function TestTokensHeuristic

internal/ctx/ctx_test.go:26–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

24}
25
26func TestTokensHeuristic(t *testing.T) {
27 cases := map[string]int{
28 "": 0,
29 "a": 1,
30 "abcd": 1,
31 "abcde": 2,
32 "12345678": 2,
33 }
34 for s, want := range cases {
35 if got := Tokens(s); got != want {
36 t.Errorf("Tokens(%q) = %d, want %d", s, got, want)
37 }
38 }
39}
40
41// TestMessageTokensCountsToolCallArguments pins ToolCall.Arguments accounting
42// in Message.Tokens: it feeds the budget on every tool-using turn, yet no

Callers

nothing calls this directly

Calls 1

TokensFunction · 0.85

Tested by

no test coverage detected