MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / TEST_F

Function TEST_F

eval/public/structs/cel_proto_wrapper_test.cc:136–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134};
135
136TEST_F(CelProtoWrapperTest, TestType) {
137 Duration msg_duration;
138 msg_duration.set_seconds(2);
139 msg_duration.set_nanos(3);
140 CelValue value_duration1 = CelProtoWrapper::CreateDuration(&msg_duration);
141 EXPECT_THAT(value_duration1.type(), Eq(CelValue::Type::kDuration));
142
143 CelValue value_duration2 =
144 CelProtoWrapper::CreateMessage(&msg_duration, arena());
145 EXPECT_THAT(value_duration2.type(), Eq(CelValue::Type::kDuration));
146
147 Timestamp msg_timestamp;
148 msg_timestamp.set_seconds(2);
149 msg_timestamp.set_nanos(3);
150 CelValue value_timestamp1 = CelProtoWrapper::CreateTimestamp(&msg_timestamp);
151 EXPECT_THAT(value_timestamp1.type(), Eq(CelValue::Type::kTimestamp));
152
153 CelValue value_timestamp2 =
154 CelProtoWrapper::CreateMessage(&msg_timestamp, arena());
155 EXPECT_THAT(value_timestamp2.type(), Eq(CelValue::Type::kTimestamp));
156}
157
158// This test verifies CelValue support of Duration type.
159TEST_F(CelProtoWrapperTest, TestDuration) {

Callers

nothing calls this directly

Calls 15

EncodeDurationFunction · 0.85
EqualsProtoFunction · 0.85
EncodeTimeFunction · 0.85
CreateContainerBackedMapFunction · 0.85
typeMethod · 0.80
DurationOrDieMethod · 0.80
TimestampOrDieMethod · 0.80
MapOrDieMethod · 0.80
BoolOrDieMethod · 0.80
DoubleOrDieMethod · 0.80
StringOrDieMethod · 0.80
codeMethod · 0.80

Tested by

no test coverage detected