# File test/backup/tc_dos_disks.rb, line 25
  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 we can write muliple files (this also tests we are correctly tracking sectors as being used)
    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
    
    #make sure we can overwrite the same file (which also tests we are freeing sectors when files are deleted)
    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   

    #TODO #add a 40K file, 
  end