summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/index_key_validate_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/catalog/index_key_validate_test.cpp')
-rw-r--r--src/mongo/db/catalog/index_key_validate_test.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/index_key_validate_test.cpp b/src/mongo/db/catalog/index_key_validate_test.cpp
index 9c4813a2d2e..c60df1b34aa 100644
--- a/src/mongo/db/catalog/index_key_validate_test.cpp
+++ b/src/mongo/db/catalog/index_key_validate_test.cpp
@@ -426,6 +426,20 @@ TEST(IndexKeyValidateTest, RepairIndexSpecs) {
NamespaceString("coll"),
fromjson("{key: {a: 1}, name: 'index', sparse: 'true', background: '1', safe: "
"true, force: true}"))));
+
+ ASSERT(BSON("key" << BSON("a" << 1) << "name"
+ << "index"
+ << "expireAfterSeconds" << std::numeric_limits<int32_t>::max())
+ .binaryEqual(index_key_validate::repairIndexSpec(
+ NamespaceString("coll"),
+ fromjson("{key: {a: 1}, name: 'index', expireAfterSeconds: NaN}"))));
+
+ ASSERT(BSON("key" << BSON("a" << 1) << "name"
+ << "index"
+ << "expireAfterSeconds" << std::numeric_limits<int32_t>::max())
+ .binaryEqual(index_key_validate::repairIndexSpec(
+ NamespaceString("coll"),
+ fromjson("{key: {a: 1}, name: 'index', expireAfterSeconds: '123'}"))));
}
TEST(IndexKeyValidateTest, GeoIndexSpecs) {