MCPcopy Create free account
hub / github.com/apache/tvm-ffi / TEST

Function TEST

tests/cpp/test_expected.cc:38–46  ·  view source on GitHub ↗

Test implicit construction from success value

Source from the content-addressed store, hash-verified

36
37// Test implicit construction from success value
38TEST(Expected, BasicOk) {
39 Expected<int> result = 42;
40
41 EXPECT_TRUE(result.is_ok());
42 EXPECT_FALSE(result.is_err());
43 EXPECT_TRUE(result.has_value());
44 EXPECT_EQ(result.value(), 42);
45 EXPECT_EQ(result.value_or(0), 42);
46}
47
48// Test implicit construction from error
49TEST(Expected, BasicErr) {

Callers

nothing calls this directly

Calls 15

UnexpectedClass · 0.85
is_okMethod · 0.80
is_errMethod · 0.80
errorMethod · 0.80
definedMethod · 0.80
TIntClass · 0.70
ErrorClass · 0.50
StringClass · 0.50
has_valueMethod · 0.45
valueMethod · 0.45
value_orMethod · 0.45
kindMethod · 0.45

Tested by

no test coverage detected