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
puts dsk.dump_catalog
dsk.save_as("dos_write_test.dsk")
for i in 0..20
assert_equal(test_files[i],dsk.files[test_files[i].filename])
end
for i in 0..250
t=dsk.make_file("MULTICOPY","TEST #{i} ")
puts "iteratio #{i}"
dsk.add_file(t)
assert_equal(t,dsk.files[t.filename])
end
end