Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
21
backend/internal/util/claude_tool_id_test.go
Normal file
21
backend/internal/util/claude_tool_id_test.go
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
package util
|
||||
|
||||
import "testing"
|
||||
|
||||
func TestGeminiClaudeToolUseIDStableAndBound(t *testing.T) {
|
||||
args := `{"file_path":"/tmp/a","old_string":"x","new_string":"y"}`
|
||||
first := GeminiClaudeToolUseID("native-call-1", "Edit", args)
|
||||
second := GeminiClaudeToolUseID("native-call-1", "Edit", `{"new_string":"y","old_string":"x","file_path":"/tmp/a"}`)
|
||||
if first == "" || first != second || !IsGeminiClaudeToolUseID(first) {
|
||||
t.Fatalf("stable tool id mismatch: first=%q second=%q", first, second)
|
||||
}
|
||||
if changed := GeminiClaudeToolUseID("native-call-1", "Edit", `{"file_path":"/tmp/a","old_string":"x","new_string":"z"}`); changed == first {
|
||||
t.Fatal("tool id must be bound to native call semantics")
|
||||
}
|
||||
if GeminiClaudeToolUseID("", "Edit", args) != "" {
|
||||
t.Fatal("ID-less provider calls must keep the existing fallback path")
|
||||
}
|
||||
if IsGeminiClaudeToolUseID("toolu_client_value") {
|
||||
t.Fatal("ordinary client tool IDs must not be treated as CPA provenance IDs")
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue