aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--csc/compare-test.csc76
-rw-r--r--csc/compare.csc26
2 files changed, 51 insertions, 51 deletions
diff --git a/csc/compare-test.csc b/csc/compare-test.csc
index 6df177f..68ea5e6 100644
--- a/csc/compare-test.csc
+++ b/csc/compare-test.csc
@@ -9,13 +9,13 @@
(test diff-list
(assert-equal
- " (
- 1
- -2
- 3
- +3.5
- 4
- )
+ " (
+ 1
+ - 2
+ 3
+ + 3.5
+ 4
+ )
"
(diff '(1 2 3 4) '(1 3 3.5 4))))
@@ -30,53 +30,53 @@
(test diff-record
(assert-equal
- " (
- (a .
- 5
- )
- (b .
- -5
- +6
- )
- (type .
- <test-type>
+ " (
+ (a .
+ 5
+ )
+ (b .
+ - 5
+ + 6
+ )
+ (type .
+ <test-type>
+ )
)
- )
"
(diff (make-test-type 5 5) (make-test-type 5 6) (cons test-type? %test-type))))
(test diff-multiline-string
(assert-equal
- " (
- (type .
- string
- )
- (value .
- (
- line-one
- -line-two
- line-three
+ " (
+ (type .
+ string
+ )
+ (value .
+ (
+ line-one
+ - line-two
+ line-three
+ )
)
)
- )
"
(diff "line-one\nline-two\nline-three" "line-one\nline-three")))
(test diff-vector
(assert-equal
- " (
- (type .
- vector
- )
- (value .
- (
- 1
- -2
- 3
+ " (
+ (type .
+ vector
+ )
+ (value .
+ (
+ 1
+ - 2
+ 3
+ )
)
)
- )
"
(diff #(1 2 3) #(1 3))))
diff --git a/csc/compare.csc b/csc/compare.csc
index cbf8b6d..ab7e3c1 100644
--- a/csc/compare.csc
+++ b/csc/compare.csc
@@ -77,17 +77,17 @@
(define (pretty w x indent)
(cond
((list? x)
- (fprintf w "{}(\n" indent)
+ (fprintf w "{} (\n" indent)
(loop with new-indent = (string-append indent " ")
for v in x
do (pretty w v new-indent))
- (fprintf w "{})\n" indent))
+ (fprintf w "{} )\n" indent))
((and (pair? x)
(symbol? (car x)))
- (fprintf w "{}({} .\n" indent (car x))
+ (fprintf w "{} ({} .\n" indent (car x))
(pretty w (cdr x) (string-append indent " "))
- (fprintf w "{})\n" indent))
- (else (fprintf w "{}{}\n" indent x))))
+ (fprintf w "{} )\n" indent))
+ (else (fprintf w "{} {}\n" indent x))))
(define (diff* w x y indent)
@@ -99,13 +99,13 @@
(and (string? x) (string? y)))
(if (equal? x y)
(begin
- (fprintf w "{} {}\n" indent x)
+ (fprintf w "{} {}\n" indent x)
#t)
(begin
- (fprintf w "{}-{}\n{}+{}\n" indent x indent y)
+ (fprintf w "{}- {}\n{}+ {}\n" indent x indent y)
#f)))
((and (alist? x) (alist? y))
- (fprintf w "{} (\n" indent)
+ (fprintf w "{} (\n" indent)
(let ((key-lcs (lcs (map car x) (map car y) symbol=?))
(indent* (string-append indent " "))
(equal #t))
@@ -123,10 +123,10 @@
(set! equal #f)
else
if (symbol=? (caar x) (caar y) (car key-lcs))
- do (fprintf w "{} ({} .\n" indent* (car key-lcs))
+ do (fprintf w "{} ({} .\n" indent* (car key-lcs))
(set! equal (and (diff* w (cdar x) (cdar y) (string-append indent* " "))
equal))
- (fprintf w "{} )\n" indent*)
+ (fprintf w "{} )\n" indent*)
(set! x (cdr x))
(set! y (cdr y))
(set! key-lcs (cdr key-lcs))
@@ -138,10 +138,10 @@
do (pretty w (car x) (string-append indent* "-"))
(set! x (cdr x))
(set! equal #f))
- (fprintf w "{} )\n" indent)
+ (fprintf w "{} )\n" indent)
equal))
((and (list? x) (list? y))
- (fprintf w "{} (\n" indent)
+ (fprintf w "{} (\n" indent)
(let* ((common (lcs x y equal?))
(indent* (string-append indent " "))
(equal #t))
@@ -181,7 +181,7 @@
(set! x (cdr x))
(set! y (cdr y))
(set! equal #f))
- (fprintf w "{} )\n" indent)
+ (fprintf w "{} )\n" indent)
equal))))