(t *testing.T)
| 153 | } |
| 154 | |
| 155 | func TestMapCopy(t *testing.T) { |
| 156 | orig := model.NewValue(orderedmap.NewMap().Set("a", "one").Set("b", "two")) |
| 157 | cp, err := orig.MapCopy() |
| 158 | if err != nil { |
| 159 | t.Fatal(err) |
| 160 | } |
| 161 | // Modify original |
| 162 | if err := orig.SetMapKey("a", model.NewStringValue("modified")); err != nil { |
| 163 | t.Fatal(err) |
| 164 | } |
| 165 | // Copy should be unchanged |
| 166 | val, err := cp.GetMapKey("a") |
| 167 | if err != nil { |
| 168 | t.Fatal(err) |
| 169 | } |
| 170 | got, err := val.StringValue() |
| 171 | if err != nil { |
| 172 | t.Fatal(err) |
| 173 | } |
| 174 | if got != "one" { |
| 175 | t.Errorf("expected 'one', got %s", got) |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | func TestMapKeyExists(t *testing.T) { |
| 180 | m := model.NewValue(orderedmap.NewMap().Set("exists", "val")) |
nothing calls this directly
no test coverage detected