@@ -38,11 +38,21 @@ var _ = Describe("Diff.Calculate", func() {
3838 )
3939 })
4040
41- It ("can replace doc root" , func () {
42- testDiff (nil , "a" , []Op {
43- TestOp {Path : MustNewPointerFromString ("" ), Value : nil },
41+ It ("can skip test operations" , func () {
42+ expectedOps := []Op {
4443 ReplaceOp {Path : MustNewPointerFromString ("" ), Value : "a" },
45- })
44+ }
45+
46+ var left interface {}
47+ right := "a"
48+
49+ diffOps := Diff {Left : left , Right : right , Unchecked : true }.Calculate ()
50+ Expect (diffOps ).To (Equal (Ops (expectedOps )))
51+
52+ result , err := Ops (diffOps ).Apply (left )
53+ Expect (err ).ToNot (HaveOccurred ())
54+
55+ Expect (result ).To (Equal (right ))
4656 })
4757
4858 It ("can replace doc root with nil" , func () {
@@ -52,6 +62,13 @@ var _ = Describe("Diff.Calculate", func() {
5262 })
5363 })
5464
65+ It ("can replace doc root" , func () {
66+ testDiff (nil , "a" , []Op {
67+ TestOp {Path : MustNewPointerFromString ("" ), Value : nil },
68+ ReplaceOp {Path : MustNewPointerFromString ("" ), Value : "a" },
69+ })
70+ })
71+
5572 It ("can diff maps" , func () {
5673 testDiff (
5774 map [interface {}]interface {}{"a" : 123 },
0 commit comments