MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / TEST

Function TEST

crates/c-api/tests/error.cc:6–15  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4using namespace wasmtime;
5
6TEST(Result, Simple) {
7 Result<int> ok_result(1);
8 EXPECT_TRUE(ok_result);
9 EXPECT_EQ(ok_result.ok(), 1);
10 EXPECT_EQ(ok_result.unwrap(), 1);
11
12 Result<int, std::string> err_result("x");
13 EXPECT_FALSE(err_result);
14 EXPECT_EQ(err_result.err(), "x");
15}
16
17TEST(Error, Simple) {
18 Error err("hello");

Callers

nothing calls this directly

Calls 5

i32_exitMethod · 0.80
okMethod · 0.45
unwrapMethod · 0.45
errMethod · 0.45
messageMethod · 0.45

Tested by

no test coverage detected