Ejemplo n.º 1
0
    TEST(Options, NameIsHonored) {
        IndexSpec spec;
        spec.addKey("aField");

        // Should get an auto generated name
        ASSERT_FALSE(spec.name().empty());

        // That is not the name we are about to set.
        ASSERT_NE("someName", spec.name());

        spec.name("someName");

        // Should get the name we specified.
        ASSERT_EQ("someName", spec.name());

        // Name can be changed as many times as we want
        spec.name("yetAnotherName");
        ASSERT_EQ("yetAnotherName", spec.name());
    }