| 47 | } |
| 48 | |
| 49 | TEST(NodeMatchers, CheckAgainstConstant) { |
| 50 | Scope root = Scope::NewRootScope().ExitOnError(); |
| 51 | Output placeholder = |
| 52 | ops::Placeholder(root.WithOpName("placeholder"), DT_FLOAT); |
| 53 | |
| 54 | EXPECT_THAT(placeholder.node(), NodeWith(Op("Placeholder"))); |
| 55 | EXPECT_THAT(placeholder.node(), NodeWith(Name("placeholder"))); |
| 56 | EXPECT_THAT(placeholder.node(), |
| 57 | NodeWith(Op("Placeholder"), Name("placeholder"))); |
| 58 | EXPECT_THAT(placeholder.node(), |
| 59 | NodeWith(Name("placeholder"), Op("Placeholder"))); |
| 60 | EXPECT_THAT(placeholder.node(), NodeWith(Inputs())); |
| 61 | EXPECT_THAT(placeholder.node(), |
| 62 | NodeWith(Op("Placeholder"), Name("placeholder"), Inputs())); |
| 63 | |
| 64 | EXPECT_EQ(Explain(placeholder.node(), NodeWith(Op("Add"))), |
| 65 | "\nexpected op Add but found Placeholder"); |
| 66 | EXPECT_EQ(Explain(placeholder.node(), NodeWith(Name("add"))), |
| 67 | "\nexpected name add but found placeholder"); |
| 68 | EXPECT_EQ(Explain(placeholder.node(), NodeWith(Inputs(Out(NodeWith())))), |
| 69 | "\nexpected 1 inputs but node has 0"); |
| 70 | } |
| 71 | |
| 72 | TEST(NodeMatchers, CheckAgainstBinary) { |
| 73 | Scope root = Scope::NewRootScope().ExitOnError(); |
nothing calls this directly
no test coverage detected