🐛 Account for file ids > 9

This commit is contained in:
Dan Jones 2024-12-09 14:34:01 -06:00
commit 495d50ba10
7 changed files with 40 additions and 37 deletions

View file

@ -7,16 +7,15 @@ import (
)
type tt struct {
name string
diskMap []byte
blocks []byte
defragged []byte
name string
diskMap []byte
blocks []int
}
func sampleTests() []tt {
return []tt{
{"short", []byte("12345"), []byte("0..111....22222"), []byte("022111222......")},
{"longer", []byte("2333133121414131402"), []byte("00...111...2...333.44.5555.6666.777.888899"), []byte("0099811188827773336446555566..............")},
{"short", []byte("12345"), []int{0, -1, -1, 1, 1, 1, -1, -1, -1, -1, 2, 2, 2, 2, 2}},
{"longer", []byte("2333133121414131402"), []int{0, 0, -1, -1, -1, 1, 1, 1, -1, -1, -1, 2, -1, -1, -1, 3, 3, 3, -1, 4, 4, -1, 5, 5, 5, 5, -1, 6, 6, 6, 6, -1, 7, 7, 7, -1, 8, 8, 8, 8, 9, 9}},
}
}