                     throw err
 
     go()
-    client.live += "more stuffklajsdf lasdjf lasdj flasdjf lasjdfljas dfaklsdjflkasjd flajsdflkjasdklfj"
-    server.live = 'bar' + server.live + "lkajsdfllkjasdfl jasdlfj alsdkfjas'dfjlkasdjflasjdfkljasdf"
+    if DocClass?
+        client.live = new DocClass("bar more stuffklajsdf lasdjf lasdj flasdjf lasjdfljas dfaklsdjflkasjd flajsdflkjasdklfj" + misc.uuid())
+        server.live = new DocClass("bar lkajsdfllkjasdfl jasdlfj alsdkfjasdfjlkasdjflasjdfkljasdf" + misc.uuid())
+    else
+        client.live += "more stuffklajsdf lasdjf lasdj flasdjf lasjdfljas dfaklsdjflkasjd flajsdflkjasdklfj" + misc.uuid()
+        server.live = 'bar' + server.live + "lkajsdfllkjasdfl jasdlfj alsdkfjas'dfjlkasdjflasjdfkljasdf" + misc.uuid()
     status()
-    while client.live != server.live
+    while not Doc_equal(client.live, server.live)
         status()
         go()
     status()

                    @live = result
                    cb()


test0 = (client, server) ->
    client.live = "sage"
    server.live = "my\nsage"
    status = () ->
        #console.log("------------------------")
        #console.log(misc.to_json(client.status()))
        #console.log(misc.to_json(server.status()))
        console.log("------------------------")
        console.log("'#{client.live}'")
        console.log("'#{server.live}'")

    pusher = undefined
    go = () ->

        console.log(misc.to_json(server.status()))

exports.test4 = (n=1) ->
    # Just use the standard dmp functions on strings again.
    copy      = (s) -> s
    diff      = (v0,v1)  -> dmp.patch_make(v0,v1)
    patch     = (d, doc) -> dmp.patch_apply(d, doc)[0]
