File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
src/test/java/io/ipfs/api Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -48,4 +48,24 @@ public void binaryRecursiveAdd() throws Exception {
48
48
MerkleNode node = add .get (add .size () - 1 );
49
49
Assert .assertEquals (EXPECTED , node .hash .toBase58 ());
50
50
}
51
+
52
+ @ Test
53
+ public void largeBinaryRecursiveAdd () throws Exception {
54
+ String EXPECTED = "QmZdfdj7nfxE68fBPUWAGrffGL3sYGx1MDEozMg73uD2wj" ;
55
+
56
+ Path base = Paths .get ("tmplargebindata" );
57
+ base .toFile ().mkdirs ();
58
+ byte [] bindata = new byte [100 * 1024 *1024 ];
59
+ new Random (28 ).nextBytes (bindata );
60
+ Files .write (base .resolve ("data.bin" ), bindata );
61
+ new Random (496 ).nextBytes (bindata );
62
+ Files .write (base .resolve ("data2.bin" ), bindata );
63
+ Path js = base .resolve ("js" );
64
+ js .toFile ().mkdirs ();
65
+ Files .write (js .resolve ("func.js" ), "function() {console.log('Hey');}" .getBytes ());
66
+
67
+ List <MerkleNode > add = ipfs .add (new NamedStreamable .FileWrapper (base .toFile ()));
68
+ MerkleNode node = add .get (add .size () - 1 );
69
+ Assert .assertEquals (EXPECTED , node .hash .toBase58 ());
70
+ }
51
71
}
You can’t perform that action at this time.
0 commit comments