From 11299af1a430ea449b4c3cf5cea7d46b9d966437 Mon Sep 17 00:00:00 2001 From: chetz Date: Tue, 10 Aug 2004 11:48:40 +0000 Subject: [PATCH] just some "cosmetic" changes --- scsh/test/awk-test.scm | 46 +++++++++++++++--------------------------- 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/scsh/test/awk-test.scm b/scsh/test/awk-test.scm index cd8d6c4..7f33734 100644 --- a/scsh/test/awk-test.scm +++ b/scsh/test/awk-test.scm @@ -21,21 +21,6 @@ (lambda (ch) (list->string (list ch)))) -(define reverse-string - (lambda (str) - (list->string (reverse (string->list str))))) - - -;; *** help-functions *** - -(define str-palindrom? - (lambda (str) - (equal? str (reverse-string str)))) - -(define int-palindrom? - (lambda (i) - (str-palindrom? (number->string i)))) - ;; *** tests *** ;; --- is the incremented correct --- @@ -85,19 +70,20 @@ ;(add-test! 'read-one-mb-line-from-file 'awk ; (lambda () -; (let ((one-mb-line (let loop ((i 0)) -; (if (= 1048576 i) -; "" -; (string-append "a" (loop (+ i 1)))))) -; (read '())) +; (let* ((one-kb-line (let loop ((i 0)) +; (if (= 1024 i) +; "" +; (string-append "a" (loop (+ i 1)))))) +; (one-mb-line (let loop ((i 0)) +; (if (= 1024 i) +; "" +; (string-append one-kb-line (loop (+ i 1)))))) +; (read '())) ; ((lambda (in-port) ; (awk (read-line in-port) (line) c () -; (#t (begin -; (set! read line))))) +; (#t (set! read line)))) ; (make-string-input-port one-mb-line)) -; (and (string? read) -; (= (string-length read) -; 1048576))))) +; (equal? read one-mb-line)))) ;; --- special signs --- @@ -106,17 +92,17 @@ (let (( strange-sign-line (let loop ((i 0)) (if (= i 256) - "\n" + "" (if (= i 10) ;; works with everything but line-feed (loop (+ i 1)) (string-append (ascii->string i) - (loop (+ i 1))))))) + (loop (+ i 1))))))) (read '())) ((lambda (in-port) - (awk (read-line in-port) (line) () - (#t (set! read line)))) + (awk (read-line in-port) (line) () + (#t (set! read line)))) (make-string-input-port strange-sign-line)) - (equal? (string-append read "\n") strange-sign-line)))) + (equal? read strange-sign-line)))) ;; --- sre-expr-test ---