Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added test to check for bugfor long strings

  • Loading branch information...
commit 3d4a880f6294853c9721f2a8d95dc4ea479ad1c4 1 parent db15138
@christkv authored
Showing with 24 additions and 0 deletions.
  1. +24 −0 test/insert_test.js
View
24 test/insert_test.js
@@ -1175,6 +1175,30 @@ exports.shouldCorrectlyPerformUpsertAgainstNewDocumentAndExistingOne = function(
}
/**
+ * @ignore
+ */
+exports.shouldCorrectlyPerformLargeTextInsert = function(test) {
+ client.createCollection('shouldCorrectlyPerformLargeTextInsert', function(err, collection) {
+ // Create large string, insert and then retrive
+ var string = "";
+ // Create large text field
+ for(var i = 0; i < 50000; i++) {
+ string = string + "a";
+ }
+
+ collection.insert({a:1, string:string}, {safe:true}, function(err, result) {
+ test.equal(null, err);
+
+ collection.findOne({a:1}, function(err, doc) {
+ test.equal(null, err);
+ test.equal(50000, doc.string.length);
+ test.done();
+ });
+ });
+ });
+}
+
+/**
* Retrieve the server information for the current
* instance of the db client
*
Please sign in to comment.
Something went wrong with that request. Please try again.