Skip to content

Commit ca865ab

Browse files
committed
bugfix: testdata was invalid.. why\?!
1 parent 0392e79 commit ca865ab

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

test/data.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
module.exports = {
2-
binKeyData: new Buffer("ZDU6ZmlsZXNkMjA6N7VVuuCjmp5LoM+n15a5iM/XJHdkODpjb21wbGV0ZWkwZTEwOmRvd25sb2FkZWRpMTBlMTA6aW5jb21wbGV0ZWkwZWVlZQ==", 'base64')
3-
, binKeyName: (new Buffer("N++/vVXvv73go5rvv71L77+9z6fXlu+/ve+/ve+/ve+/vSR3", 'base64')).toString()
2+
//binKeyData: new Buffer("ZDU6ZmlsZXNkMjA6N7VVuuCjmp5LoM+n15a5iM/XJHdkODpjb21wbGV0ZWkwZTEwOmRvd25sb2FkZWRpMTBlMTA6aW5jb21wbGV0ZWkwZWVlZQ==", 'base64')
3+
binKeyData: new Buffer('ZDU6ZmlsZXNkMzY6N++/vVXvv73go5rvv71L77+9z6fXlu+/ve+/ve+/ve+/vSR3ZDg6Y29tcGxldGVpMGUxMDpkb3dubG9hZGVkaTEwZTEwOmluY29tcGxldGVpMGVlZWU=', 'base64')
4+
, binKeyName: new Buffer("N++/vVXvv73go5rvv71L77+9z6fXlu+/ve+/ve+/ve+/vSR3", 'base64')
45
, binStringData: new Buffer('w7bCsXNkZg==', 'base64')
56
, binResultData: new Buffer('NzrDtsKxc2Rm', 'base64')
67
}

test/decode.utf8.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test("bencode#decode(x, 'uft8')", function(t) {
2121
t.test('should be able to decode "binary keys"', function(t) {
2222
t.plan(1)
2323
var decoded = bencode.decode(data.binKeyData, 'utf8')
24-
t.ok(decoded.files.hasOwnProperty(data.binKeyName))
24+
t.ok(decoded.files.hasOwnProperty(data.binKeyName.toString('utf8')))
2525
})
2626

2727
t.test('should be able to decode a dictionary', function(t) {

0 commit comments

Comments
 (0)