Skip to content

vm: Add Equatable for StackItem #2983

@cschuchardt88

Description

@cschuchardt88

It would be nice to have Equatable for comparing StackItem class to Array, Map, etc in the VM.

Array a2 = new() { "Hello World", true };
StackItem a3 = new Array() { "Hello World", true };
Assert.Equal(a2, a3);

Output

Assert.Equal() Failure
Expected: Array [ByteString { IsNull = False, Memory = System.ReadOnlyMemory<Byte>[11], Size = 11, Type = ByteString }, Boolean { IsNull = False, Memory = System.ReadOnlyMemory<Byte>[1], Size = 1, Type = Boolean }]
Actual:   Array [ByteString { IsNull = False, Memory = System.ReadOnlyMemory<Byte>[11], Size = 11, Type = ByteString }, Boolean { IsNull = False, Memory = System.ReadOnlyMemory<Byte>[1], Size = 1, Type = Boolean }]

Metadata

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions