diff --git a/tests/diff.carp b/tests/diff.carp index 8f42bc2..531737f 100644 --- a/tests/diff.carp +++ b/tests/diff.carp @@ -169,12 +169,12 @@ lines")) "line-diff of identical strings is all equal") &(Diff.eq &(char-diff "hello" "hello")) "char-diff of identical strings is all equal") - (assert-equal test &(String.concat &[@"@@ -1,3 +1,3 @@ -" @" line1 -" @"+changed -" @"-line2 -" @" line3 -"]) &(unified &(line-diff "line1 + (assert-equal test "@@ -1,3 +1,3 @@ + line1 ++changed +-line2 + line3 +" &(unified &(line-diff "line1 line2 line3" "line1 changed @@ -182,46 +182,46 @@ line3")) "unified renders single-hunk diff with correct header") (assert-equal test "" &(unified &(line-diff "same text" "same text")) "unified of identical strings is empty") - (assert-equal test &(String.concat &[@"@@ -1,4 +1,4 @@ -" @"+new -" @"-old -" @" a -" @" b -" @" c -"]) &(unified &(line-diff "old + (assert-equal test "@@ -1,4 +1,4 @@ ++new +-old + a + b + c +" &(unified &(line-diff "old a b c" "new a b c")) "unified handles change at start") - (assert-equal test &(String.concat &[@"@@ -1,4 +1,4 @@ -" @" a -" @" b -" @" c -" @"+new -" @"-old -"]) &(unified &(line-diff "a + (assert-equal test "@@ -1,4 +1,4 @@ + a + b + c ++new +-old +" &(unified &(line-diff "a b c old" "a b c new")) "unified handles change at end") - (assert-equal test &(String.concat &[@"@@ -1,5 +1,5 @@ -" @" a -" @"+BB -" @"-b -" @" c -" @" d -" @" e -" @"@@ -8,4 +8,4 @@ -" @" h -" @" i -" @" j -" @"+KK -" @"-k -"]) &(unified &(line-diff "a + (assert-equal test "@@ -1,5 +1,5 @@ + a ++BB +-b + c + d + e +@@ -8,4 +8,4 @@ + h + i + j ++KK +-k +" &(unified &(line-diff "a b c d @@ -329,20 +329,20 @@ KK")) "unified generates multiple hunks for distant changes") "str of Insertion with multiple elements") ; unified-with-context - (assert-equal test &(String.concat &[@"@@ -2,1 +2,1 @@ -" @"+changed -" @"-line2 -"]) &(unified-with-context &(line-diff "line1 + (assert-equal test "@@ -2,1 +2,1 @@ ++changed +-line2 +" &(unified-with-context &(line-diff "line1 line2 line3" "line1 changed line3") 0) "unified-with-context 0 omits context lines") - (assert-equal test &(String.concat &[@"@@ -1,3 +1,3 @@ -" @" line1 -" @"+changed -" @"-line2 -" @" line3 -"]) &(unified-with-context &(line-diff "line1 + (assert-equal test "@@ -1,3 +1,3 @@ + line1 ++changed +-line2 + line3 +" &(unified-with-context &(line-diff "line1 line2 line3" "line1 changed @@ -356,17 +356,17 @@ line2 line3" "line1 changed line3") 3) "unified-with-context 3 is identical to unified") - (assert-equal test &(String.concat &[@"@@ -1,3 +1,3 @@ -" @" a -" @"+BB -" @"-b -" @" c -" @"@@ -5,3 +5,3 @@ -" @" e -" @"+FF -" @"-f -" @" g -"]) &(unified-with-context &(line-diff "a + (assert-equal test "@@ -1,3 +1,3 @@ + a ++BB +-b + c +@@ -5,3 +5,3 @@ + e ++FF +-f + g +" &(unified-with-context &(line-diff "a b c d