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

Method Run

tests/runtime/results/runner.cpp:72–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72void exports::runner::Run()
73{
74 using namespace ::test::results::test;
75
76 assert(equal(StringError(0.0), std::expected<float, std::string_view>(std::unexpected("zero"))));
77 assert(equal(StringError(1.0), std::expected<float, std::string_view>(1.0)));
78
79 assert(equal(EnumError(0.0), std::expected<float, E>(std::unexpected(E::kA))));
80 assert(equal(EnumError(1.0), std::expected<float, E>(1.0)));
81
82 assert(equal(RecordError(0.0), std::expected<float, E2>(std::unexpected(E2{420,0}))));
83 assert(equal(RecordError(1.0), std::expected<float, E2>(std::unexpected(E2{77,2}))));
84 assert(equal(RecordError(2.0), std::expected<float, E2>(2.0)));
85
86 assert(equal(VariantError(0.0), std::expected<float, E3>(std::unexpected(E3{E3::E2{E2{420,0}}}))));
87 assert(equal(VariantError(1.0), std::expected<float, E3>(std::unexpected(E3{E3::E1{E::kB}}))));
88 assert(equal(VariantError(2.0), std::expected<float, E3>(std::unexpected(E3{E3::E1{E::kC}}))));
89
90 assert(equal(EmptyError(0), std::expected<uint32_t, wit::Void>(std::unexpected(wit::Void{}))));
91 assert(equal(EmptyError(1), std::expected<uint32_t, wit::Void>(42)));
92 assert(equal(EmptyError(2), std::expected<uint32_t, wit::Void>(2)));
93
94 assert(equal(DoubleError(0), std::expected<std::expected<void, std::string_view>, std::string_view>(std::expected<void, std::string_view>())));
95 assert(equal(DoubleError(1), std::expected<std::expected<void, std::string_view>, std::string_view>(std::expected<void, std::string_view>(std::unexpected("one")))));
96 assert(equal(DoubleError(2), std::expected<std::expected<void, std::string_view>, std::string_view>(std::unexpected("two"))));
97}

Callers

nothing calls this directly

Calls 9

unexpectedClass · 0.85
equalFunction · 0.70
StringErrorFunction · 0.70
EnumErrorFunction · 0.70
RecordErrorFunction · 0.70
VariantErrorFunction · 0.70
EmptyErrorFunction · 0.70
DoubleErrorFunction · 0.70
assertFunction · 0.50

Tested by

no test coverage detected