diff options
author | Eric Blossom | 2010-11-23 22:25:51 -0800 |
---|---|---|
committer | Eric Blossom | 2010-11-23 22:25:51 -0800 |
commit | 17b63012f821a85924c174b7d89f1236ba4ac5d0 (patch) | |
tree | 22e11b6809bca72d3428358fd50a2e44adfac52b /gnuradio-core/src/guile | |
parent | a213cbed474164ed31a26fd4dbdbe3f13c293b6e (diff) | |
download | gnuradio-17b63012f821a85924c174b7d89f1236ba4ac5d0.tar.gz gnuradio-17b63012f821a85924c174b7d89f1236ba4ac5d0.tar.bz2 gnuradio-17b63012f821a85924c174b7d89f1236ba4ac5d0.zip |
Move verbose-equal? to lib.scm
Diffstat (limited to 'gnuradio-core/src/guile')
-rw-r--r-- | gnuradio-core/src/guile/gnuradio/test-suite/lib.scm | 13 | ||||
-rw-r--r-- | gnuradio-core/src/guile/tests/general_ctors.test | 8 |
2 files changed, 11 insertions, 10 deletions
diff --git a/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm b/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm index 458e627de..abdc89632 100644 --- a/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm +++ b/gnuradio-core/src/guile/gnuradio/test-suite/lib.scm @@ -20,6 +20,7 @@ :use-module (ice-9 stack-catch) :use-module (ice-9 regex) :use-module (ice-9 syncase) + :use-module (ice-9 format) :export ( ;; Exceptions which are commonly being tested for. @@ -597,9 +598,9 @@ (define-syntax test-equal (syntax-rules () ((_ expected test-expr) - (pass-if (equal? expected test-expr))) + (pass-if (verbose-equal? expected test-expr))) ((_ name expected test-exprt) - (pass-if name (equal? expected test-expr))))) + (pass-if name (verbose-equal? expected test-expr))))) ;;; (test-eqv [name] expected test-expr) (define-syntax test-eqv @@ -616,3 +617,11 @@ (pass-if (eq? expected test-expr))) ((_ name expected test-exprt) (pass-if name (eq? expected test-expr))))) + + +(define-public (verbose-equal? expected actual) + (cond ((equal? expected actual) #t) + (else + (format #t "Expected:\n~y\n" expected) + (format #t "Actual:\n~y\n" actual) + #f))) diff --git a/gnuradio-core/src/guile/tests/general_ctors.test b/gnuradio-core/src/guile/tests/general_ctors.test index ff5ee74fa..244249dd8 100644 --- a/gnuradio-core/src/guile/tests/general_ctors.test +++ b/gnuradio-core/src/guile/tests/general_ctors.test @@ -31,14 +31,6 @@ (use-modules (ice-9 format)) -(define (verbose-equal? expected actual) - (cond ((equal? expected actual) #t) - (else - (format #t "Expected:\n~y\n" expected) - (format #t "Actual:\n~y\n" actual) - #f))) - - ;;; Test complex<float> scalars (pass-if (equal? 5.0+5.0i (gr:complex-scalar-test0))) (pass-if (equal? 1.5+0.5i (gr:complex-scalar-test1 1+1i))) |