From 150e0c9f48256d956137860dda1b824d5dc5707e Mon Sep 17 00:00:00 2001 From: "Rodrigo B. de Oliveira" Date: Sun, 1 Dec 2024 08:06:30 -0300 Subject: [PATCH] Let diff with golden test file ignore trailling cr For compatibility with windows. --- test/test-main.scm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/test-main.scm b/test/test-main.scm index cce7776..ac99d8e 100644 --- a/test/test-main.scm +++ b/test/test-main.scm @@ -19,12 +19,16 @@ (call-with-input-file path (lambda (p) (read-string 65535 p)))) +(define (diff file1 file2) + (system (format #f "diff --strip-trailing-cr --color=auto -u ~a ~a" file1 file2))) + (define* (golden-scene-test scene golden-file) (let ((output-file "bin/s7_scheme_tests.txt")) (call-with-output-file output-file (lambda (p) (write-string (godot scene) p))) - (unless (= 0 (system (format #f "diff --color=auto -u ~a ~a" golden-file output-file))) - (error 'assertion-error "ERROR: output of scene `~a` doesn't match golden file `~a`." scene golden-file)))) + (unless (= 0 (diff golden-file output-file)) + (error 'assertion-error + "ERROR: output of scene `~a` doesn't match golden file `~a`." scene golden-file)))) (define (golden-scene-tests) (golden-scene-test