def test_write_to_dsk
dsk=DSK.create_new(:dos33)
test_file=TextFile.new("TESTFILE","Is this mike on?")
dsk.add_file(test_file)
assert(dsk.files[test_file.filename]!=nil,"dsk should have a file called #{test_file.filename}")
assert_equal(test_file,dsk.files[test_file.filename])
test_files=[]
for i in 0..20
t=dsk.make_file("TEST#{i}","TEST #{i} "+"*"*i*100)
test_files<<t
dsk.add_file(t)
end
for i in 0..20
assert_equal(test_files[i],dsk.files[test_files[i].filename])
end
[
TextFile,
BinaryFile,
AppleSoftFile
].each do |file_class|
test_file=file_class.new("TEST_"+file_class.to_s.upcase,"\FF"*256)
dsk.add_file(test_file)
assert_equal(test_file,dsk.files[test_file.filename])
end
for i in 0..250
t=dsk.make_file("MULTICOPY","TEST #{i} ")
dsk.add_file(t)
assert_equal(t,dsk.files[t.filename])
end
for i in 0..20
assert_equal(test_files[i],dsk.files[test_files[i].filename])
end
dsk.save_as("dos_write_test.dsk")
end