All tests working again (including double-late-join)

This commit is contained in:
DadaMonad
2015-01-08 15:08:44 +00:00
parent a1b07f84ea
commit ef9e183138
13 changed files with 106 additions and 108 deletions

View File

@@ -37,7 +37,7 @@ class JsonTest extends Test
@getRandomRoot user_num, p
getContent: (user_num)->
@users[user_num].toJson()
@users[user_num].toJson(true)
getGeneratingFunctions: (user_num)->
types = @users[user_num].types
@@ -124,9 +124,11 @@ describe "JsonFramework", ->
u2 = @yTest.users[1]
ops1 = u1.HB._encode()
ops2 = u2.HB._encode()
u1.HB.renewStateVector u2.HB.getOperationCounter()
u2.HB.renewStateVector u1.HB.getOperationCounter()
u1.engine.applyOps ops2
u2.engine.applyOps ops1
expect(test.getContent(0)).to.equal(@yTest.getContent(1))
expect(test.getContent(0)).to.deep.equal(@yTest.getContent(1))
it "can handle creaton of complex json (1)", ->
@yTest.users[0].val('a', 'q')

View File

@@ -194,6 +194,8 @@ module.exports = class Test
testHBencoding: ()->
# in case of JsonFramework, every user will create its JSON first! therefore, the testusers id must be small than all the others (see InsertType)
@users[@users.length] = @makeNewUser (-1) # this does not want to join with anymody
@users[@users.length-1].HB.renewStateVector @users[0].HB.getOperationCounter()
@users[@users.length-1].engine.applyOps @users[0].HB._encode()
#if @getContent(@users.length-1) isnt @getContent(0)

View File

@@ -114,6 +114,7 @@ describe "TextFramework", ->
u.unobserve observer2
it "can handle many engines, many operations, concurrently (random)", ->
console.log("testiy deleted this TODO:dtrn")
@yTest.run()