Removing unnecessary newlines and making tests newline accurate
This commit is contained in:
parent
3041bc2870
commit
04d3a23e1c
|
@ -48,10 +48,9 @@
|
||||||
(format-external e)]))
|
(format-external e)]))
|
||||||
(define (format-questions ls)
|
(define (format-questions ls)
|
||||||
(v-concat
|
(v-concat
|
||||||
(append (map (lambda (l)
|
(map (lambda (l)
|
||||||
(h-append (format-question l) dot))
|
(h-append (format-question l) dot))
|
||||||
ls)
|
ls)))
|
||||||
(list line))))
|
|
||||||
(define (format-clause c)
|
(define (format-clause c)
|
||||||
(if (empty? (clause-body c))
|
(if (empty? (clause-body c))
|
||||||
(format-literal (clause-head c))
|
(format-literal (clause-head c))
|
||||||
|
|
|
@ -14,15 +14,11 @@
|
||||||
(define test-rkt (build-path examples-dir (format "~a.rkt" t)))
|
(define test-rkt (build-path examples-dir (format "~a.rkt" t)))
|
||||||
(define test-txt (build-path examples-dir (format "~a.txt" t)))
|
(define test-txt (build-path examples-dir (format "~a.txt" t)))
|
||||||
(test-equal? t
|
(test-equal? t
|
||||||
(filter (lambda (l)
|
|
||||||
(not (string=? l "")))
|
|
||||||
(with-input-from-string
|
(with-input-from-string
|
||||||
(with-output-to-string
|
(with-output-to-string
|
||||||
(lambda () (dynamic-require test-rkt #f)))
|
(lambda () (dynamic-require test-rkt #f)))
|
||||||
port->lines))
|
port->lines)
|
||||||
(filter (lambda (l)
|
(file->lines test-txt)))
|
||||||
(not (string=? l "")))
|
|
||||||
(file->lines test-txt))))
|
|
||||||
|
|
||||||
(define (test-files d)
|
(define (test-files d)
|
||||||
(for ([f (in-list (directory-list d))]
|
(for ([f (in-list (directory-list d))]
|
||||||
|
|
|
@ -14,4 +14,3 @@ path(d, d).
|
||||||
path(d, c).
|
path(d, c).
|
||||||
path(d, b).
|
path(d, b).
|
||||||
path(d, a).
|
path(d, a).
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,3 @@ path(d, b).
|
||||||
path(d, c).
|
path(d, c).
|
||||||
path(d, d).
|
path(d, d).
|
||||||
path(d, a).
|
path(d, a).
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,3 @@ path(d, d).
|
||||||
path(d, c).
|
path(d, c).
|
||||||
path(d, b).
|
path(d, b).
|
||||||
path(d, a).
|
path(d, a).
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,3 @@ perm(c, a).
|
||||||
perm(b, a).
|
perm(b, a).
|
||||||
perm(b, c).
|
perm(b, c).
|
||||||
perm(c, b).
|
perm(c, b).
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,19 @@
|
||||||
parent(john, douglas).
|
parent(john, douglas).
|
||||||
|
|
||||||
|
|
||||||
parent(john, douglas).
|
parent(john, douglas).
|
||||||
parent(bob, john).
|
parent(bob, john).
|
||||||
parent(ebbon, bob).
|
parent(ebbon, bob).
|
||||||
|
|
||||||
parent(john, douglas).
|
parent(john, douglas).
|
||||||
|
|
||||||
|
|
||||||
ancestor(ebbon, bob).
|
ancestor(ebbon, bob).
|
||||||
ancestor(bob, john).
|
ancestor(bob, john).
|
||||||
ancestor(john, douglas).
|
ancestor(john, douglas).
|
||||||
ancestor(bob, douglas).
|
ancestor(bob, douglas).
|
||||||
ancestor(ebbon, john).
|
ancestor(ebbon, john).
|
||||||
ancestor(ebbon, douglas).
|
ancestor(ebbon, douglas).
|
||||||
|
|
||||||
ancestor(bob, john).
|
ancestor(bob, john).
|
||||||
ancestor(ebbon, john).
|
ancestor(ebbon, john).
|
||||||
|
|
||||||
parent(john, douglas).
|
parent(john, douglas).
|
||||||
parent(ebbon, bob).
|
parent(ebbon, bob).
|
||||||
|
|
||||||
ancestor(ebbon, bob).
|
ancestor(ebbon, bob).
|
||||||
ancestor(john, douglas).
|
ancestor(john, douglas).
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
add1(2) = (3).
|
add1(2) = (3).
|
||||||
|
|
||||||
add2(1, 3).
|
add2(1, 3).
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,3 @@ path(d, d).
|
||||||
path(d, c).
|
path(d, c).
|
||||||
path(d, b).
|
path(d, b).
|
||||||
path(d, a).
|
path(d, a).
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,3 @@ path(d, b).
|
||||||
path(d, c).
|
path(d, c).
|
||||||
path(d, d).
|
path(d, d).
|
||||||
path(d, a).
|
path(d, a).
|
||||||
|
|
||||||
|
|
|
@ -14,4 +14,3 @@ path(d, d).
|
||||||
path(d, c).
|
path(d, c).
|
||||||
path(d, b).
|
path(d, b).
|
||||||
path(d, a).
|
path(d, a).
|
||||||
|
|
||||||
|
|
|
@ -4,5 +4,3 @@ perm(c, a).
|
||||||
perm(b, a).
|
perm(b, a).
|
||||||
perm(b, c).
|
perm(b, c).
|
||||||
perm(c, b).
|
perm(c, b).
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,26 +1,19 @@
|
||||||
parent(john, douglas).
|
parent(john, douglas).
|
||||||
|
|
||||||
|
|
||||||
parent(john, douglas).
|
parent(john, douglas).
|
||||||
parent(bob, john).
|
parent(bob, john).
|
||||||
parent(ebbon, bob).
|
parent(ebbon, bob).
|
||||||
|
|
||||||
parent(john, douglas).
|
parent(john, douglas).
|
||||||
|
|
||||||
|
|
||||||
ancestor(ebbon, bob).
|
ancestor(ebbon, bob).
|
||||||
ancestor(bob, john).
|
ancestor(bob, john).
|
||||||
ancestor(john, douglas).
|
ancestor(john, douglas).
|
||||||
ancestor(bob, douglas).
|
ancestor(bob, douglas).
|
||||||
ancestor(ebbon, john).
|
ancestor(ebbon, john).
|
||||||
ancestor(ebbon, douglas).
|
ancestor(ebbon, douglas).
|
||||||
|
|
||||||
ancestor(bob, john).
|
ancestor(bob, john).
|
||||||
ancestor(ebbon, john).
|
ancestor(ebbon, john).
|
||||||
|
|
||||||
parent(john, douglas).
|
parent(john, douglas).
|
||||||
parent(ebbon, bob).
|
parent(ebbon, bob).
|
||||||
|
|
||||||
ancestor(ebbon, bob).
|
ancestor(ebbon, bob).
|
||||||
ancestor(john, douglas).
|
ancestor(john, douglas).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user