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:20:35 -0400
committerADAM David Alan Martin <adam.martin@10gen.com>2019-07-27 11:02:23 -0400
commit134a4083953270e8a11430395357fb70a29047ad (patch)
treedd428e1230e31d92b20b393dfdc17ffe7fa79cb6 /jstests/aggregation/bugs/server22580.js
parent1e46b5049003f427047e723ea5fab15b5a9253ca (diff)
downloadmongo-134a4083953270e8a11430395357fb70a29047ad.tar.gz
SERVER-41772 Apply clang-format 7.0.1 to the codebase
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.");
}());