@@ -5,15 +5,7 @@ const DAGService = require('ipfs-merkle-dag').DAGService
5
5
const DAGNode = require ( 'ipfs-merkle-dag' ) . DAGNode
6
6
const UnixFS = require ( 'ipfs-unixfs' )
7
7
8
- const FixedSizeChunker = require ( './../src/chunker-fixed-size' )
9
8
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
- }
17
9
18
10
const smallBuf = require ( 'buffer!./test-data/200Bytes.txt' )
19
11
const bigBuf = require ( 'buffer!./test-data/1.2MiB.txt' )
@@ -22,63 +14,6 @@ const bigLink = require('buffer!./test-data/1.2MiB.txt.link-block0')
22
14
const marbuf = require ( 'buffer!./test-data/200Bytes.txt.block' )
23
15
24
16
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
-
82
17
describe ( 'layout: importer' , function ( ) {
83
18
it ( 'import a small buffer' , function ( done ) {
84
19
// this is just like "import a small file"
0 commit comments