         else
             # insert about 25 characters at random
             s = s.slice(0,i) + Math.random().toString(36).slice(2) + s.slice(i)
-        @set(s)
+        @_doc.from_str(s)
 
     test_random_edits: (opts) =>
         opts = defaults opts,

                        exists = x
                        if not exists
                            dbg("file no longer exists")
                            @set('')
                        cb(err)
            (cb) =>
                if exists

                        @_file_watcher.close()
                        return
                    dbg("delete: setting deleted=true and closing")
                    @_doc.from_str('')
                    @save () =>
                        # NOTE: setting deleted=true must be done **after** setting document to blank above,
                        # since otherwise the set would set deleted=false.
