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

Function testResultRoundtrip

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

Source from the content-addressed store, hash-verified

145}
146
147func testResultRoundtrip() {
148 m := test.NamesById{5: "five"}
149 okResult := test.ResultRoundtrip(Ok[test.NamesById, string](m))
150 assertEqual(okResult.Tag(), ResultOk)
151 assertEqual(okResult.Ok()[5], "five")
152
153 errResult := test.ResultRoundtrip(Err[test.NamesById, string]("bad input"))
154 assertEqual(errResult.Tag(), ResultErr)
155 assertEqual(errResult.Err(), "bad input")
156}
157
158func testTupleRoundtrip() {
159 m := test.NamesById{7: "seven"}

Callers 1

RunFunction · 0.85

Calls 1

assertEqualFunction · 0.70

Tested by

no test coverage detected