(t *testing.T)
| 298 | } |
| 299 | |
| 300 | func TestMapValue(t *testing.T) { |
| 301 | mp := make(map[interface{}]interface{}, 0) |
| 302 | mp["key"] = "value" |
| 303 | mp["key2"] = "value2" |
| 304 | |
| 305 | mp2 := make(map[interface{}]interface{}, 0) |
| 306 | mp2["key2"] = "value2" |
| 307 | checkMultiStackOpCode(t, []OpCode{SWAP, TOALTSTACK, DUPFROMALTSTACK, SWAP, REMOVE, FROMALTSTACK}, |
| 308 | []Value{mp, "key"}, |
| 309 | []Value{mp2}, |
| 310 | ) |
| 311 | |
| 312 | checkMultiStackOpCode(t, []OpCode{HASKEY}, []Value{mp, "key"}, []Value{true}) |
| 313 | checkMultiStackOpCode(t, []OpCode{KEYS}, []Value{mp}, []Value{[]Value{"key", "key2"}}) |
| 314 | checkMultiStackOpCode(t, []OpCode{VALUES}, []Value{mp}, []Value{[]Value{"value", "value2"}}) |
| 315 | checkMultiStackOpCode(t, []OpCode{PICKITEM}, []Value{mp, "key"}, []Value{"value"}) |
| 316 | checkMultiStackOpCode(t, []OpCode{TOALTSTACK, DUPFROMALTSTACK, SETITEM, FROMALTSTACK}, |
| 317 | []Value{mp, "key", "value3"}, []Value{"value3"}) |
| 318 | m := make(map[interface{}]interface{}, 0) |
| 319 | checkStackOpCode(t, NEWMAP, []Value{}, []Value{m}) |
| 320 | |
| 321 | } |
| 322 | func TestStructValue(t *testing.T) { |
| 323 | s := types.NewStructValue() |
| 324 | k, err := types.VmValueFromBytes([]byte("key")) |
nothing calls this directly
no test coverage detected