@@ -140,12 +140,22 @@ const strategyOverrides = {
140140 size : 2669627 ,
141141 type : 'directory'
142142 } ,
143- '200Bytes.txt with raw leaves' : {
143+ '200Bytes.txt with raw leaves' : extend ( { } , baseFiles [ '200Bytes.txt' ] , {
144144 cid : 'QmagyRwMfYhczYNv5SvcJc8xxXjZQBTTHS2jEqNMva2mYT' ,
145- size : 200 ,
146- path : '200Bytes.txt' ,
147- type : 'file'
148- } ,
145+ size : 200
146+ } ) ,
147+ '200Bytes.txt with raw leaves and mode' : extend ( { } , baseFiles [ '200Bytes.txt' ] , {
148+ cid : 'QmRYYSoRkL9bh5gzbgHndWjt81TYnM4W7MjzTp8WWioLGB' ,
149+ size : 200
150+ } ) ,
151+ '200Bytes.txt with raw leaves and mtime' : extend ( { } , baseFiles [ '200Bytes.txt' ] , {
152+ cid : 'QmQ1QHqXqgxJ4qjJZouRdYG7pdS6yzdhSAq7dYAu9bN6h4' ,
153+ size : 200
154+ } ) ,
155+ '200Bytes.txt with raw leaves and metadata' : extend ( { } , baseFiles [ '200Bytes.txt' ] , {
156+ cid : 'QmWUpftnvHN1Ey5iGoaWwMUZPnViXeJctDSUkcvunkahFo' ,
157+ size : 200
158+ } ) ,
149159 'foo/bar' : {
150160 cid : 'QmTGMxKPzSGNBDp6jhTwnZxGW6w1S9ciyycRJ4b2qcQaHK' ,
151161 size : 0 ,
@@ -260,7 +270,18 @@ strategies.forEach((strategy) => {
260270 type : 'directory'
261271 } ,
262272 '200Bytes.txt with raw leaves' : extend ( { } , baseFiles [ '200Bytes.txt' ] , {
263- cid : 'QmQmZQxSKQppbsWfVzBvg59Cn3DKtsNVQ94bjAxg2h3Lb8' ,
273+ cid : 'zb2rhXrz1gkCv8p4nUDZRohY6MzBE9C3HVTVDP72g6Du3SD9Q'
274+ } ) ,
275+ '200Bytes.txt with raw leaves and mode' : extend ( { } , baseFiles [ '200Bytes.txt' ] , {
276+ cid : 'QmWXbKV9BKJqd8x1NUw1myH987bURrn9Rna3rszYJgQwtX' ,
277+ size : 200
278+ } ) ,
279+ '200Bytes.txt with raw leaves and mtime' : extend ( { } , baseFiles [ '200Bytes.txt' ] , {
280+ cid : 'QmYfLToWgeJwrFFKideGNaS1zkmrow1a9o862sUL43NapC' ,
281+ size : 200
282+ } ) ,
283+ '200Bytes.txt with raw leaves and metadata' : extend ( { } , baseFiles [ '200Bytes.txt' ] , {
284+ cid : 'QmVfHowk2oKuWFyVwSRt8H1dQ3v272jyWSwhfQnTtWNmfw' ,
264285 size : 200
265286 } )
266287 } , strategyOverrides [ strategy ] )
@@ -443,6 +464,58 @@ strategies.forEach((strategy) => {
443464 ] )
444465 } )
445466
467+ it ( 'small file (smaller than a chunk) with raw leaves and mode' , async ( ) => {
468+ const files = await all ( importer ( [ {
469+ path : '200Bytes.txt' ,
470+ content : smallFile ,
471+ mode : 0o123
472+ } ] , ipld , {
473+ ...options ,
474+ rawLeaves : true
475+ } ) )
476+
477+ expectFiles ( files , [
478+ '200Bytes.txt with raw leaves and mode'
479+ ] )
480+ } )
481+
482+ it ( 'small file (smaller than a chunk) with raw leaves and mtime' , async ( ) => {
483+ const files = await all ( importer ( [ {
484+ path : '200Bytes.txt' ,
485+ content : smallFile ,
486+ mtime : {
487+ secs : 10 ,
488+ nsecs : 0
489+ }
490+ } ] , ipld , {
491+ ...options ,
492+ rawLeaves : true
493+ } ) )
494+
495+ expectFiles ( files , [
496+ '200Bytes.txt with raw leaves and mtime'
497+ ] )
498+ } )
499+
500+ it ( 'small file (smaller than a chunk) with raw leaves and metadata' , async ( ) => {
501+ const files = await all ( importer ( [ {
502+ path : '200Bytes.txt' ,
503+ content : smallFile ,
504+ mode : 0o123 ,
505+ mtime : {
506+ secs : 10 ,
507+ nsecs : 0
508+ }
509+ } ] , ipld , {
510+ ...options ,
511+ rawLeaves : true
512+ } ) )
513+
514+ expectFiles ( files , [
515+ '200Bytes.txt with raw leaves and metadata'
516+ ] )
517+ } )
518+
446519 it ( 'small file (smaller than a chunk) inside a dir' , async ( ) => {
447520 const files = await all ( importer ( [ {
448521 path : 'foo/bar/200Bytes.txt' ,
0 commit comments