mirror of
https://github.com/tjboldt/ProDOS-Utilities.git
synced 2024-11-28 12:51:35 +00:00
29 lines
467 B
Go
29 lines
467 B
Go
package prodos
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
)
|
|
|
|
func TestCreateVolumeBitmap(t *testing.T) {
|
|
var tests = []struct {
|
|
blocks int
|
|
want int
|
|
}{
|
|
{65536, 8192},
|
|
{65533, 8192},
|
|
{140, 512},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
testname := fmt.Sprintf("%d", tt.blocks)
|
|
t.Run(testname, func(t *testing.T) {
|
|
volumeBitMap := CreateVolumeBitmap(tt.blocks)
|
|
ans := len(volumeBitMap)
|
|
if ans != tt.want {
|
|
t.Errorf("got %d, want %d", ans, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|