summaryrefslogtreecommitdiff
path: root/jstests/aggregation/bugs/server22580.js
diff options
context:
space:
mode:
authorclang-format-7.0.1 <adam.martin@10gen.com>2019-07-26 18:42:24 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-07-26 18:42:24 -0400
commitc1a45ebbb0530e3d0201321d725527f1eb83ffce (patch)
treef523079dc5ded3052eefbdcaae424b7502df5b25 /jstests/aggregation/bugs/server22580.js
parentc9599d8610c3da0b7c3da65667aff821063cf5b9 (diff)
downloadmongo-c1a45ebbb0530e3d0201321d725527f1eb83ffce.tar.gz
Apply formatting per `clang-format-7.0.1`
Diffstat (limited to 'jstests/aggregation/bugs/server22580.js')
-rw-r--r--jstests/aggregation/bugs/server22580.js79
1 files changed, 42 insertions, 37 deletions
diff --git a/jstests/aggregation/bugs/server22580.js b/jstests/aggregation/bugs/server22580.js
index 3a448173875..3b9f81dbcfc 100644
--- a/jstests/aggregation/bugs/server22580.js
+++ b/jstests/aggregation/bugs/server22580.js
@@ -3,41 +3,46 @@
load("jstests/aggregation/extras/utils.js"); // For assertErrorCode.
(function() {
- "use strict";
-
- var coll = db.substrCP;
- coll.drop();
-
- // Need an empty document for pipeline.
- coll.insert({});
-
- assertErrorCode(coll,
- [{$project: {substr: {$substrCP: ["abc", 0, "a"]}}}],
- 34452,
- "$substrCP" + " does not accept non-numeric types as a length.");
-
- assertErrorCode(coll,
- [{$project: {substr: {$substrCP: ["abc", 0, NaN]}}}],
- 34453,
- "$substrCP" + " does not accept non-integers as a length.");
-
- assertErrorCode(coll,
- [{$project: {substr: {$substrCP: ["abc", "abc", 3]}}}],
- 34450,
- "$substrCP does not accept non-numeric types as a starting index.");
-
- assertErrorCode(coll,
- [{$project: {substr: {$substrCP: ["abc", 2.2, 3]}}}],
- 34451,
- "$substrCP" + " does not accept non-integers as a starting index.");
-
- assertErrorCode(coll,
- [{$project: {substr: {$substrCP: ["abc", -1, 3]}}}],
- 34455,
- "$substrCP " + "does not accept negative integers as inputs.");
-
- assertErrorCode(coll,
- [{$project: {substr: {$substrCP: ["abc", 1, -3]}}}],
- 34454,
- "$substrCP " + "does not accept negative integers as inputs.");
+"use strict";
+
+var coll = db.substrCP;
+coll.drop();
+
+// Need an empty document for pipeline.
+coll.insert({});
+
+assertErrorCode(coll,
+ [{$project: {substr: {$substrCP: ["abc", 0, "a"]}}}],
+ 34452,
+ "$substrCP" +
+ " does not accept non-numeric types as a length.");
+
+assertErrorCode(coll,
+ [{$project: {substr: {$substrCP: ["abc", 0, NaN]}}}],
+ 34453,
+ "$substrCP" +
+ " does not accept non-integers as a length.");
+
+assertErrorCode(coll,
+ [{$project: {substr: {$substrCP: ["abc", "abc", 3]}}}],
+ 34450,
+ "$substrCP does not accept non-numeric types as a starting index.");
+
+assertErrorCode(coll,
+ [{$project: {substr: {$substrCP: ["abc", 2.2, 3]}}}],
+ 34451,
+ "$substrCP" +
+ " does not accept non-integers as a starting index.");
+
+assertErrorCode(coll,
+ [{$project: {substr: {$substrCP: ["abc", -1, 3]}}}],
+ 34455,
+ "$substrCP " +
+ "does not accept negative integers as inputs.");
+
+assertErrorCode(coll,
+ [{$project: {substr: {$substrCP: ["abc", 1, -3]}}}],
+ 34454,
+ "$substrCP " +
+ "does not accept negative integers as inputs.");
}());