Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
tap -> tape + faucet
Browse files Browse the repository at this point in the history
  • Loading branch information
ralphtheninja committed May 1, 2015
1 parent 91341fd commit 82479b6
Show file tree
Hide file tree
Showing 20 changed files with 51 additions and 63 deletions.
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
},
"devDependencies": {
"du": "~0.1.0",
"faucet": "0.0.1",
"mkfiletree": "~0.0.1",
"monotonic-timestamp": "~0.0.8",
"node-gyp": "~1.0.1",
Expand All @@ -43,10 +44,10 @@
"readfiletree": "~0.0.1",
"rimraf": "~2.2.8",
"slump": "~2.0.0",
"tap": "~0.4.12"
"tape": "~4.0.0"
},
"scripts": {
"test": "tap test/*-test.js --stderr"
"test": "tape test/*-test.js | faucet"
},
"license": "MIT",
"gypfile": true
Expand Down
5 changes: 2 additions & 3 deletions test/approximate-size-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/approximate-size-test')

if (require.main === module)
abstract.all(leveldown, test, testCommon)
abstract.all(leveldown, test, testCommon)
5 changes: 2 additions & 3 deletions test/batch-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/batch-test')

if (require.main === module)
abstract.all(leveldown, test, testCommon)
abstract.all(leveldown, test, testCommon)
5 changes: 2 additions & 3 deletions test/chained-batch-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/chained-batch-test')

if (require.main === module)
abstract.all(leveldown, test, testCommon)
abstract.all(leveldown, test, testCommon)
4 changes: 2 additions & 2 deletions test/cleanup-hanging-iterators-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, makeTest = require('./make-test')
, makeTest = require('./make')

makeTest('test ended iterator', function (db, t, done) {
// standard iterator with an end() properly called, easy
Expand Down
5 changes: 2 additions & 3 deletions test/close-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/close-test')
Expand All @@ -19,5 +19,4 @@ module.exports.all = function (leveldown) {
module.exports.tearDown()
}

if (require.main === module)
module.exports.all(leveldown)
module.exports.all(leveldown)
5 changes: 2 additions & 3 deletions test/del-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/del-test')

if (require.main === module)
abstract.all(leveldown, test, testCommon)
abstract.all(leveldown, test, testCommon)
4 changes: 2 additions & 2 deletions test/destroy-test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const test = require('tap').test
const test = require('tape')
, fs = require('fs')
, path = require('path')
, mkfiletree = require('mkfiletree')
, readfiletree = require('readfiletree')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, makeTest = require('./make-test')
, makeTest = require('./make')

test('test argument-less destroy() throws', function (t) {
t.throws(
Expand Down
5 changes: 2 additions & 3 deletions test/get-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/get-test')

if (require.main === module)
abstract.all(leveldown, test, testCommon)
abstract.all(leveldown, test, testCommon)
4 changes: 2 additions & 2 deletions test/getproperty-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')

Expand Down Expand Up @@ -54,4 +54,4 @@ test('test invalid getProperty("leveldb.sstables")', function (t) {

test('tearDown', function (t) {
db.close(testCommon.tearDown.bind(null, t))
})
})
25 changes: 12 additions & 13 deletions test/iterator-recursion-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, child_process = require('child_process')
Expand Down Expand Up @@ -32,20 +32,19 @@ test('try to create an iterator with a blown stack', function (t) {
// Reducing the stack size down from the default 984 for the child node
// process makes it easier to trigger the bug condition. But making it too low
// causes the child process to die for other reasons.
var opts = { execArgv: ["--stack-size=128"] }
, child = child_process.fork(__dirname + '/stack-blower.js', ["run"], opts)
var opts = { execArgv: [ '--stack-size=128' ] }
, child = child_process.fork(__dirname + '/stack-blower.js', [ 'run' ], opts)

t.plan(2)

child.on('message', function (m) {
t.ok(true, m)
child.disconnect()

t.end()
})
.on('exit', function (code, sig) {
t.ok(false, "Child exited with code=" + code + " sig=" + sig)
t.ok(true, m)
child.disconnect()
})

t.end()
})
child.on('exit', function (code, sig) {
t.equal(code, 0, 'child exited normally')
})
})

test('iterate over a large iterator with a large watermark', function (t) {
Expand All @@ -69,4 +68,4 @@ test('iterate over a large iterator with a large watermark', function (t) {

test('tearDown', function (t) {
db.close(testCommon.tearDown.bind(null, t))
})
})
5 changes: 2 additions & 3 deletions test/iterator-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/iterator-test')

if (require.main === module)
abstract.all(leveldown, test, testCommon)
abstract.all(leveldown, test, testCommon)
5 changes: 2 additions & 3 deletions test/leveldown-test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const test = require('tap').test
const test = require('tape')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/leveldown-test')

if (require.main === module)
abstract.args(leveldown, test)
abstract.args(leveldown, test)
4 changes: 2 additions & 2 deletions test/make-test.js → test/make.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, cleanup = testCommon.cleanup
, location = testCommon.location
Expand Down Expand Up @@ -35,4 +35,4 @@ function makeTest (name, testFn) {
})
}

module.exports = makeTest
module.exports = makeTest
5 changes: 2 additions & 3 deletions test/open-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/open-test')

if (require.main === module)
abstract.all(leveldown, test, testCommon)
abstract.all(leveldown, test, testCommon)
2 changes: 1 addition & 1 deletion test/port-libuv-fix-test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const test = require('tap').test
const test = require('tape')
, path = require('path')
, fs = require('fs')

Expand Down
5 changes: 2 additions & 3 deletions test/put-get-del-test.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, fs = require('fs')
, path = require('path')
, testBuffer = fs.readFileSync(path.join(__dirname, 'data/testdata.bin'))
, abstract = require('abstract-leveldown/abstract/put-get-del-test')

if (require.main === module)
abstract.all(leveldown, test, testCommon, testBuffer)
abstract.all(leveldown, test, testCommon, testBuffer)
5 changes: 2 additions & 3 deletions test/put-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/put-test')

if (require.main === module)
abstract.all(leveldown, test, testCommon)
abstract.all(leveldown, test, testCommon)
5 changes: 2 additions & 3 deletions test/ranges-test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const test = require('tap').test
const test = require('tape')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, abstract = require('abstract-leveldown/abstract/ranges-test')

if (require.main === module)
abstract.all(leveldown, test, testCommon)
abstract.all(leveldown, test, testCommon)
6 changes: 3 additions & 3 deletions test/repair-test.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
const test = require('tap').test
const test = require('tape')
, fs = require('fs')
, path = require('path')
, mkfiletree = require('mkfiletree')
, readfiletree = require('readfiletree')
, testCommon = require('abstract-leveldown/testCommon')
, leveldown = require('../')
, makeTest = require('./make-test')
, makeTest = require('./make')

test('test argument-less repair() throws', function (t) {
t.throws(
Expand All @@ -27,7 +27,7 @@ test('test callback-less, 1-arg, repair() throws', function (t) {

test('test repair non-existant directory returns error', function (t) {
leveldown.repair('/1/2/3/4', function (err) {
t.like(/no such/i, err, 'error on callback')
t.ok(/no such/i.test(err), 'error on callback')
t.end()
})
})
Expand Down

0 comments on commit 82479b6

Please sign in to comment.