Skip to content

Commit f2cf541

Browse files
committed
Merge pull request #15 from noffle/remove_chunker_tests
removes remaining chunker tests
2 parents be715c7 + ae73cf0 commit f2cf541

File tree

1 file changed

+0
-65
lines changed

1 file changed

+0
-65
lines changed

tests/buffer-test.js

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,7 @@ const DAGService = require('ipfs-merkle-dag').DAGService
55
const DAGNode = require('ipfs-merkle-dag').DAGNode
66
const UnixFS = require('ipfs-unixfs')
77

8-
const FixedSizeChunker = require('./../src/chunker-fixed-size')
98
const expect = require('chai').expect
10-
const stringToStream = require('string-to-stream')
11-
const through = require('through2')
12-
13-
const myFile = require('buffer!./test-data/1.2MiB.txt')
14-
const fileStream = function () {
15-
return stringToStream(myFile)
16-
}
179

1810
const smallBuf = require('buffer!./test-data/200Bytes.txt')
1911
const bigBuf = require('buffer!./test-data/1.2MiB.txt')
@@ -22,63 +14,6 @@ const bigLink = require('buffer!./test-data/1.2MiB.txt.link-block0')
2214
const marbuf = require('buffer!./test-data/200Bytes.txt.block')
2315

2416
module.exports = function (repo) {
25-
describe('chunker: fixed size', function () {
26-
this.timeout(10000)
27-
28-
it('256 Bytes chunks', function (done) {
29-
var counter = 0
30-
fileStream()
31-
.pipe(FixedSizeChunker(256))
32-
.pipe(through(function (chunk, enc, cb) {
33-
if (chunk.length < 256) {
34-
expect(counter).to.be.below(1)
35-
counter += 1
36-
return cb()
37-
}
38-
expect(chunk.length).to.equal(256)
39-
cb()
40-
}, () => {
41-
done()
42-
}))
43-
})
44-
45-
it('256 KiB chunks', function (done) {
46-
var counter = 0
47-
var KiB256 = 262144
48-
fileStream()
49-
.pipe(FixedSizeChunker(KiB256))
50-
.pipe(through((chunk, enc, cb) => {
51-
if (chunk.length < 262144) {
52-
expect(counter).to.be.below(1)
53-
counter += 1
54-
return cb()
55-
}
56-
expect(chunk.length).to.equal(262144)
57-
cb()
58-
}, () => {
59-
done()
60-
}))
61-
})
62-
63-
it('256 KiB chunks of non scalar filesize', function (done) {
64-
var counter = 0
65-
var KiB256 = 262144
66-
fileStream()
67-
.pipe(FixedSizeChunker(KiB256))
68-
.pipe(through((chunk, enc, cb) => {
69-
if (chunk.length < KiB256) {
70-
expect(counter).to.be.below(2)
71-
counter += 1
72-
return cb()
73-
}
74-
expect(chunk.length).to.equal(KiB256)
75-
cb()
76-
}, () => {
77-
done()
78-
}))
79-
})
80-
})
81-
8217
describe('layout: importer', function () {
8318
it('import a small buffer', function (done) {
8419
// this is just like "import a small file"

0 commit comments

Comments
 (0)