Changeset 11753 in project


Ignore:
Timestamp:
08/25/08 09:35:03 (12 years ago)
Author:
Alex Shinn
Message:

Being less strict about expect-value/expression order.

Location:
release/3/test
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/3/test/test.scm

    r11559 r11753  
    11;;;; test.scm -- simple friendly test suite
    22;;
    3 ;; Copyright (c) 2007 Alex Shinn. All rights reserved.
     3;; Copyright (c) 2007-2008 Alex Shinn. All rights reserved.
    44;; BSD-style license: http://synthcode.com/license.txt
    55
     
    2020       ((test name expect (expr ...))
    2121        (test-info name expect (expr ...) ()))
     22       ((test name (expect ...) expr)
     23        (test-syntax-error
     24         'test
     25         "the test expression should come last "
     26         (test name expect expr)))
    2227       ((test name expect expr)
    23         (let-syntax
    24             ((sym? (syntax-rules ()
    25                      ((_ expr sk fk) sk)
    26                      ((_ anything sk fk) fk))))
    27           (sym? test-symbol
    28                 (test-info name expect expr)
    29                 (test-syntax-error
    30                  'test
    31                  "the test expression should come last "
    32                  (test name expect expr)))))
     28        (test-info name expect expr))
    3329       ((test a ...)
    3430        (test-syntax-error 'test "2 or 3 arguments required"
     
    5652        (test-syntax-error 'test-error "1 or 2 arguments required"
    5753                           (test a ...)))
    58        )))
     54       ))
     55
     56;;    (define-syntax test-error*
     57;;      (syntax-rules ()
     58;;        ((_ ?msg (?error-type ...) ?expr)
     59;;         (let-syntax ((expression:
     60;;                       (syntax-rules ()
     61;;                         ((_ ?expr)
     62;;                          (condition-case (begin ?expr "<no error thrown>")
     63;;                            ((?error-type ...) '(?error-type ...))
     64;;                            (exn () (##sys#slot exn 1)))))))
     65;;           (test ?msg '(?error-type ...) (expression: ?expr))))
     66;;        ((_ ?msg ?error-type ?expr)
     67;;         (test-error* ?msg (?error-type) ?expr))
     68;;        ((_ ?error-type ?expr)
     69;;         (test-error* (sprintf "~S" '?expr) ?error-type ?expr))))
     70
     71   )
    5972
    6073 (else
     
    6679      ((pair? (cdr o))
    6780       (syntax-error 'test "2 or 3 arguments required"))
    68       ((not (pair? (car o)))
     81      ((and (pair? y) (not (pair? (car o))))
    6982       (syntax-error
    7083        'test "the test expression should come last " `(test ,x ,y ,@o)))
  • release/3/test/test.setup

    r11559 r11753  
    66 '((syntax)
    77  (require-at-runtime test-support)
    8   (version 0.9.3)))
     8  (version 0.9.4)))
Note: See TracChangeset for help on using the changeset viewer.