MCPcopy Create free account
hub / github.com/bytecodealliance/wit-bindgen / testOptionRoundtrip

Function testOptionRoundtrip

tests/runtime/map/runner.go:54–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52}
53
54func testOptionRoundtrip() {
55 input := map[string]Option[uint32]{
56 "some": Some[uint32](42),
57 "none": None[uint32](),
58 }
59 result := test.OptionRoundtrip(input)
60 assertEqual(len(result), 2)
61 assertEqual(result["some"].Some(), uint32(42))
62 assertEqual(result["none"].Tag(), OptionNone)
63}
64
65func testRecordRoundtrip() {
66 entry := test.LabeledEntry{

Callers 1

RunFunction · 0.85

Calls 2

assertEqualFunction · 0.70
OptionRoundtripMethod · 0.45

Tested by

no test coverage detected