sparsemap.yarn (3396B)
1 sparsemap tests 2 =============== 3 4 Please note that these tests will depend very much on the file 5 system, it is up to the file system to decide how many zeroes 6 are required before it decides to represent the hole as an actual 7 hole rather than just a run of zeroes. 8 9 At time of writing (2017) these tests pass on ext4, 10 where the default block size is 4096 bytes. 11 12 SCENARIO sparsemap single data followed by single hole 13 GIVEN a sparse file S with a hole size 4096 and data size 8192 with spec data,hole 14 WHEN we run sparsemap on S 15 THEN stdout contains exactly DATA 8192\nHOLE 4096 16 17 SCENARIO sparsemap single hole followed by single data 18 GIVEN a sparse file S with a hole size 4096 and data size 8192 with spec hole,data 19 WHEN we run sparsemap on S 20 THEN stdout contains exactly HOLE 4096\nDATA 8192 21 22 SCENARIO sparsemap hole followed by data followed by hole 23 GIVEN a sparse file S with a hole size 8192 and data size 4096 with spec hole,data,hole 24 WHEN we run sparsemap on S 25 THEN stdout contains exactly HOLE 8192\nDATA 4096\nHOLE 8192 26 27 SCENARIO tiny hole can look like data 28 GIVEN a sparse file S with a hole size 6 and data size 4096 with spec hole,data,hole 29 WHEN we run sparsemap on S 30 THEN stdout contains exactly DATA 4108 31 32 SCENARIO sparsemap data followed by hole followed by data 33 GIVEN a sparse file S with a hole size 8192 and data size 4096 with spec data,hole,data 34 WHEN we run sparsemap on S 35 THEN stdout contains exactly DATA 4096\nHOLE 8192\nDATA 4096 36 37 SCENARIO sparsemap sequence of holes 38 GIVEN a sparse file S with a hole size 4096 and data size 8192 with spec data,hole,hole,data 39 WHEN we run sparsemap on S 40 THEN stdout contains exactly DATA 8192\nHOLE 8192\nDATA 8192 41 42 SCENARIO sparsemap sequence of holes (ending with hole) 43 GIVEN a sparse file S with a hole size 8192 and data size 4096 with spec data,hole,hole,hole 44 WHEN we run sparsemap on S 45 THEN stdout contains exactly DATA 4096\nHOLE 24576 46 47 SCENARIO sparsemap file with only data 48 GIVEN a sparse file S with a hole size 8192 and data size 4096 with spec data 49 WHEN we run sparsemap on S 50 THEN stdout contains exactly DATA 4096 51 52 SCENARIO sparsemap file with only hole 53 GIVEN a sparse file S with a hole size 8192 and data size 4096 with spec hole 54 WHEN we run sparsemap on S 55 THEN stdout contains exactly HOLE 8192 56 57 SCENARIO sparsemap file with data,hole,data,hole,data 58 GIVEN a sparse file S with a hole size 8192 and data size 4096 with spec data,hole,data,hole,data 59 WHEN we run sparsemap on S 60 THEN stdout contains exactly DATA 4096\nHOLE 8192\nDATA 4096\nHOLE 8192\nDATA 4096 61 62 SCENARIO sparsemap file with hole,data,hole,data,hole 63 GIVEN a sparse file S with a hole size 8192 and data size 4096 with spec hole,data,hole,data,hole 64 WHEN we run sparsemap on S 65 THEN stdout contains exactly HOLE 8192\nDATA 4096\nHOLE 8192\nDATA 4096\nHOLE 8192 66 67 Generic commandline handling stuff, 68 69 SCENARIO sparsemap errs on no FILE arg 70 WHEN we attempt to run sparsemap without any arguments 71 THEN the exit code is 2 72 73 SCENARIO sparsemap errs if more than one arg 74 WHEN we attempt to run sparsemap on S T 75 THEN the exit code is 2