Skip to content

Commit

Permalink
Add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
raararaara committed May 13, 2024
1 parent e360338 commit fc008f7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/document/crdt/tree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,11 @@ func TestTreeNode(t *testing.T) {

elemWithAttrs := crdt.NewTreeNode(dummyTreeNodeID, "p", nil)
assert.NoError(t, elemWithAttrs.Append(node))
elemWithAttrs.SetAttr("e", "\"true\"", time.MaxTicket)
assert.Equal(t, `<p e="\"true\"">hello</p>`, crdt.ToXML(elemWithAttrs))

elemWithAttrs.SetAttr("b", "t", time.MaxTicket)
assert.Equal(t, `<p b="t">hello</p>`, crdt.ToXML(elemWithAttrs))
assert.Equal(t, `<p b="t" e="\"true\"">hello</p>`, crdt.ToXML(elemWithAttrs))
})
}

Expand Down

0 comments on commit fc008f7

Please sign in to comment.