summaryrefslogtreecommitdiff
path: root/jstests/aggregation/sources/densify/libs/parse_util.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/aggregation/sources/densify/libs/parse_util.js')
-rw-r--r--jstests/aggregation/sources/densify/libs/parse_util.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/jstests/aggregation/sources/densify/libs/parse_util.js b/jstests/aggregation/sources/densify/libs/parse_util.js
index 7ccedefd81d..d2e6ba4e489 100644
--- a/jstests/aggregation/sources/densify/libs/parse_util.js
+++ b/jstests/aggregation/sources/densify/libs/parse_util.js
@@ -139,6 +139,20 @@ let parseUtil = (function(db, coll, stageName, options = {}) {
}),
5733402,
"a bounding array must be an ascending array of either two dates or two numbers");
+ // Non-whole number step with date bounds
+ assert.commandFailedWithCode(
+ run({
+ [stageName]: {
+ field: "a",
+ range: {
+ step: 1.1,
+ bounds: [new ISODate("2020-01-01"), new ISODate("2020-01-03")],
+ unit: "second"
+ }
+ }
+ }),
+ 6586400,
+ "The step parameter in a range satement must be a whole number when densifying a date range");
// Positive test cases
assert.commandWorked(run({[stageName]: {field: "a", range: {step: 1.0, bounds: [1, 2]}}}));