File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
src/test/java/io/ipfs/api Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -68,4 +68,27 @@ public void largeBinaryRecursiveAdd() throws Exception {
68
68
MerkleNode node = add .get (add .size () - 1 );
69
69
Assert .assertEquals (EXPECTED , node .hash .toBase58 ());
70
70
}
71
+
72
+ @ Test
73
+ public void largeBinaryInSubdirRecursiveAdd () throws Exception {
74
+ String EXPECTED = "QmUYuMwCpgaxJhNxRA5Pmje8EfpEgU3eQSB9t3VngbxYJk" ;
75
+
76
+ Path base = Paths .get ("tmplargebininsubdirdata" );
77
+ base .toFile ().mkdirs ();
78
+ Path bindir = base .resolve ("moredata" );
79
+ bindir .toFile ().mkdirs ();
80
+ byte [] bindata = new byte [100 * 1024 *1024 ];
81
+ new Random (28 ).nextBytes (bindata );
82
+ Files .write (bindir .resolve ("data.bin" ), bindata );
83
+ new Random (496 ).nextBytes (bindata );
84
+ Files .write (bindir .resolve ("data2.bin" ), bindata );
85
+
86
+ Path js = base .resolve ("js" );
87
+ js .toFile ().mkdirs ();
88
+ Files .write (js .resolve ("func.js" ), "function() {console.log('Hey');}" .getBytes ());
89
+
90
+ List <MerkleNode > add = ipfs .add (new NamedStreamable .FileWrapper (base .toFile ()));
91
+ MerkleNode node = add .get (add .size () - 1 );
92
+ Assert .assertEquals (EXPECTED , node .hash .toBase58 ());
93
+ }
71
94
}
You can’t perform that action at this time.
0 commit comments