MCPcopy Create free account
hub / github.com/aurora-develop/aurora / TestParserBasicSingleCall

Function TestParserBasicSingleCall

internal/toolcall/parser_test.go:11–26  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestParserBasicSingleCall(t *testing.T) {
12 p := NewParser()
13 text, calls := p.Feed("I will read the file. <tool_call>{\"name\":\"read\",\"arguments\":{\"filePath\":\"/tmp/x\"}}</tool_call>")
14 if text != "I will read the file. " {
15 t.Fatalf("text = %q", text)
16 }
17 if len(calls) != 1 {
18 t.Fatalf("calls = %d, want 1", len(calls))
19 }
20 if calls[0].Function.Name != "read" || calls[0].Function.Arguments != `{"filePath":"/tmp/x"}` {
21 t.Fatalf("call = %#v", calls[0])
22 }
23 if !strings.HasPrefix(calls[0].ID, "call_") {
24 t.Fatalf("id = %q, want call_ prefix", calls[0].ID)
25 }
26}
27
28func TestParserStreamingChunked(t *testing.T) {
29 p := NewParser()

Callers

nothing calls this directly

Calls 2

FeedMethod · 0.95
NewParserFunction · 0.85

Tested by

no test coverage detected