diff options
author | Robert Newson <rnewson@apache.org> | 2011-05-28 16:50:32 +0000 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2011-05-28 16:50:32 +0000 |
commit | 697dfceee48e6dad03c2f023b5ebe0e75f5ba5cf (patch) | |
tree | 2bc170c12a0575fe9ca0f2da1d418e2e72e0f1bb /share/www/script/test/regression.js | |
parent | cc9965f8a703f2140e1e4ad2ddf2117653195946 (diff) | |
parent | 31e900ee642e672cec0b7b561c4bb596e1acf9a5 (diff) |
tagging 1.1.0
git-svn-id: https://svn.apache.org/repos/asf/couchdb/tags/1.1.0@1128705 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/regression.js')
-rw-r--r-- | share/www/script/test/regression.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/share/www/script/test/regression.js b/share/www/script/test/regression.js new file mode 100644 index 00000000..abe42b40 --- /dev/null +++ b/share/www/script/test/regression.js @@ -0,0 +1,48 @@ +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy of +// the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations under +// the License. + +couchTests.regression = function(debug) { + var db = new CouchDB("test_suite_db", {"X-Couch-Full-Commit":"false"}); + db.deleteDb(); + db.createDb(); + if (debug) debugger; + + // COUCHDB-1178 + { + var r1 = {"_id":"doc","foo":"bar"}; + var r2 = {"_id":"doc","foo":"baz","_rev":"1-4c6114c65e295552ab1019e2b046b10e"}; + var r3 = {"_id":"doc","foo":"bam","_rev":"2-cfcd6781f13994bde69a1c3320bfdadb"}; + var r4 = {"_id":"doc","foo":"bat","_rev":"3-cc2f3210d779aef595cd4738be0ef8ff"}; + + T(db.save({"_id":"_design/couchdb-1178","validate_doc_update":"function(){}"}).ok); + T(db.save(r1).ok); + T(db.save(r2).ok); + T(db.save(r3).ok); + + T(db.compact().ok); + while (db.info().compact_running) {}; + + TEquals({"_id":"doc", + "_rev":"3-cc2f3210d779aef595cd4738be0ef8ff", + "foo":"bam", + "_revisions":{"start":3, + "ids":["cc2f3210d779aef595cd4738be0ef8ff", + "cfcd6781f13994bde69a1c3320bfdadb", + "4c6114c65e295552ab1019e2b046b10e"]}}, + db.open("doc", {"revs": true})); + + TEquals([], db.bulkSave([r4, r3, r2], {"new_edits":false}), "no failures"); + } + + // cleanup + db.deleteDb(); +};
\ No newline at end of file |