Skip to content

Commit

Permalink
Avoid accessing the __private fields in tests by checking the whole…
Browse files Browse the repository at this point in the history
… struct for equality (which is the case when all members are equal).
  • Loading branch information
kpreisser committed Jun 27, 2024
1 parent ad6764d commit 219a5ff
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions tests/ValueBoxTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,11 @@ public void ItConvertsFuncRef()
var converted = box.ToValue(Store, ValueKind.FuncRef).ToValueBox(Store);
converted.Kind.Should().Be(ValueKind.FuncRef);
var unboxed = ValueBox.Converter<Function>().Unbox(Store, converted);
unboxed.func.__private.Should().Be(func.func.__private);
unboxed.func.store.Should().Be(func.func.store);
unboxed.func.Should().Be(func.func);

var value = box.ToValue(Store, ValueKind.FuncRef);
var obj = (Function)value.ToObject(Store)!;
obj.func.__private.Should().Be(func.func.__private);
obj.func.store.Should().Be(func.func.store);
obj.func.Should().Be(func.func);
}

private struct Unsupported
Expand Down

0 comments on commit 219a5ff

Please sign in to comment.