diff options
author | James Wahlin <james.wahlin@10gen.com> | 2016-05-09 09:07:56 -0400 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2016-05-09 09:07:56 -0400 |
commit | b31ca56158bb6bf70f5037e2d2a9403fb4558c04 (patch) | |
tree | bc421e6b640688ce8e95f5bba5985742af183150 /jstests | |
parent | 0ffad2b98d934a748ea23f70c3688a3d059f5a24 (diff) | |
download | mongo-b31ca56158bb6bf70f5037e2d2a9403fb4558c04.tar.gz |
SERVER-23896 Add ExpressionMod tests for infinite dividend
Diffstat (limited to 'jstests')
-rw-r--r-- | jstests/aggregation/expressions/expression_mod.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/jstests/aggregation/expressions/expression_mod.js b/jstests/aggregation/expressions/expression_mod.js index 5554ce67c11..923324797ed 100644 --- a/jstests/aggregation/expressions/expression_mod.js +++ b/jstests/aggregation/expressions/expression_mod.js @@ -13,9 +13,9 @@ load("jstests/aggregation/extras/utils.js"); // For assertErrorCode and testExp // Confirm different input numeric types are evaluated correctly. // - // Aggregate checking various combinations of number types - // The $match portion ensures they are of the correct type as the shell turns - // the ints back to doubles at the end so we can not check types with asserts + // Aggregate checking various combinations of number types. + // The $match portion ensures they are of the correct type as the shell turns the ints back to + // doubles at the end so we can not check types with assert. coll.save({}); var result = coll.aggregate( @@ -59,7 +59,7 @@ load("jstests/aggregation/extras/utils.js"); // For assertErrorCode and testExp } }); - // Correct answers (it is mainly the types that are important here) + // Correct answers (it is mainly the types that are important here). var expectedResult = [{ dub_dub: 0.5, dub_int: 0.5, @@ -91,5 +91,7 @@ load("jstests/aggregation/extras/utils.js"); // For assertErrorCode and testExp testExpression(coll, {$mod: [10, NaN]}, NaN); testExpression(coll, {$mod: [10, Infinity]}, 10); testExpression(coll, {$mod: [10, -Infinity]}, 10); + testExpression(coll, {$mod: [Infinity, 10]}, NaN); + testExpression(coll, {$mod: [-Infinity, 10]}, NaN); testExpression(coll, {$mod: [NaN, 10]}, NaN); })(); |