MCPcopy Create free account
hub / github.com/astercloud/aster / TestToolAnnotations_Clone

Function TestToolAnnotations_Clone

pkg/tools/annotations_test.go:28–56  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

26}
27
28func TestToolAnnotations_Clone(t *testing.T) {
29 original := &ToolAnnotations{
30 ReadOnly: true,
31 Destructive: false,
32 RiskLevel: 2,
33 Category: "test",
34 }
35
36 cloned := original.Clone()
37
38 if cloned.ReadOnly != original.ReadOnly {
39 t.Error("ReadOnly not cloned correctly")
40 }
41 if cloned.Destructive != original.Destructive {
42 t.Error("Destructive not cloned correctly")
43 }
44 if cloned.RiskLevel != original.RiskLevel {
45 t.Error("RiskLevel not cloned correctly")
46 }
47 if cloned.Category != original.Category {
48 t.Error("Category not cloned correctly")
49 }
50
51 // 修改克隆不应影响原始
52 cloned.RiskLevel = 5
53 if original.RiskLevel == 5 {
54 t.Error("Modifying clone should not affect original")
55 }
56}
57
58func TestToolAnnotations_IsSafeForAutoApproval(t *testing.T) {
59 tests := []struct {

Callers

nothing calls this directly

Calls 2

CloneMethod · 0.95
ErrorMethod · 0.65

Tested by

no test coverage detected