Permalink
Browse files

Added test to check for bugfor long strings

  • Loading branch information...
christkv committed Apr 7, 2012
1 parent db15138 commit 3d4a880f6294853c9721f2a8d95dc4ea479ad1c4
Showing with 24 additions and 0 deletions.
  1. +24 −0 test/insert_test.js
View
@@ -1174,6 +1174,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

0 comments on commit 3d4a880

Please sign in to comment.