(t *testing.T)
| 319 | } |
| 320 | |
| 321 | func TestHasValidSignature(t *testing.T) { |
| 322 | tests := []struct { |
| 323 | name string |
| 324 | modelName string |
| 325 | signature string |
| 326 | expected bool |
| 327 | }{ |
| 328 | {"valid long signature", testModelName, "abc123validSignature1234567890123456789012345678901234567890", true}, |
| 329 | {"exactly 50 chars", testModelName, "12345678901234567890123456789012345678901234567890", true}, |
| 330 | {"49 chars - invalid", testModelName, "1234567890123456789012345678901234567890123456789", false}, |
| 331 | {"empty string", testModelName, "", false}, |
| 332 | {"short signature", testModelName, "abc", false}, |
| 333 | {"gemini sentinel", "gemini-3-pro-preview", "skip_thought_signature_validator", true}, |
| 334 | } |
| 335 | |
| 336 | for _, tt := range tests { |
| 337 | t.Run(tt.name, func(t *testing.T) { |
| 338 | result := HasValidSignature(tt.modelName, tt.signature) |
| 339 | if result != tt.expected { |
| 340 | t.Errorf("HasValidSignature(%q) = %v, expected %v", tt.signature, result, tt.expected) |
| 341 | } |
| 342 | }) |
| 343 | } |
| 344 | } |
| 345 | |
| 346 | func TestCacheSignature_TextHashCollisionResistance(t *testing.T) { |
| 347 | ClearSignatureCache("") |
nothing calls this directly
no test coverage detected