MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / TEST

Function TEST

tensorflow/core/lib/gtl/map_util_test.cc:27–39  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25namespace tensorflow {
26
27TEST(MapUtil, Find) {
28 typedef std::map<string, string> Map;
29 Map m;
30
31 // Check that I can use a type that's implicitly convertible to the
32 // key or value type, such as const char* -> string.
33 EXPECT_EQ("", gtl::FindWithDefault(m, "foo", ""));
34 m["foo"] = "bar";
35 EXPECT_EQ("bar", gtl::FindWithDefault(m, "foo", ""));
36 EXPECT_EQ("bar", *gtl::FindOrNull(m, "foo"));
37 EXPECT_TRUE(m.count("foo") > 0);
38 EXPECT_EQ(m["foo"], "bar");
39}
40
41TEST(MapUtil, LookupOrInsert) {
42 typedef std::map<string, string> Map;

Callers

nothing calls this directly

Calls 3

FindOrNullFunction · 0.85
InsertIfNotPresentFunction · 0.85
countMethod · 0.45

Tested by

no test coverage detected