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

Commit

Permalink
tests: add failing test for #64
Browse files Browse the repository at this point in the history
  • Loading branch information
MeirionHughes committed Jun 16, 2019
1 parent 49ff8e3 commit e9d8be2
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,3 +249,31 @@ test('SubDb main function', function (t) {
})
})
})

test('Failing Tests', function (t) {
t.test('Issue #64 - sub db (as leaf) with buffer keys', function (t) {
t.plan(2)

var db = levelup(encoding(memdown()))
db.once('open', function () {
var subA = subdb(db, 'logs') // Change Key to "AAAA" and it works
var subB = subdb(db, 'data')
var subC = subdb(subB, '1234', { keyEncoding: 'buffer' })

subA.put('1234', 'FOO', function () {
subA.get('1234', 'FOO', function () {
subC.put(Buffer.from([10]), 10, function () {
subA.get('1234', 'FOO', function () {
subC.put(Buffer.from([20]), 20, function () {
subA.get('1234', function (err, value) {
t.error(err, 'no error')
t.equal(value, 'FOO')
})
})
})
})
})
})
})
})
})

0 comments on commit e9d8be2

Please sign in to comment.