(t *testing.T)
| 425 | } |
| 426 | |
| 427 | func TestFinalNudgeForUserTurn(t *testing.T) { |
| 428 | tools := []official.Tool{ |
| 429 | {Type: "function", Function: official.ToolFunction{Name: "bash"}}, |
| 430 | } |
| 431 | msgs := []official.APIMessage{ |
| 432 | {Role: "user", Content: official.MessageContent{TextValue: "Working directory: /home/x\n列出文件"}}, |
| 433 | } |
| 434 | got := FinalNudge(tools, msgs) |
| 435 | if got == "" { |
| 436 | t.Fatalf("got empty") |
| 437 | } |
| 438 | if !strings.Contains(got, "working directory: /home/x") { |
| 439 | t.Fatalf("missing wd: %s", got) |
| 440 | } |
| 441 | if !strings.Contains(got, `"bash"`) { |
| 442 | t.Fatalf("missing example: %s", got) |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | func TestFinalNudgeEmptyForOtherRole(t *testing.T) { |
| 447 | tools := []official.Tool{ |
nothing calls this directly
no test coverage detected