"racket-test" clean-up
Move a few tests, and clear out a lot of junk. original commit: 29a0c44c98d5c8d3660e4bd10eb566c7ec6e46e2
This commit is contained in:
parent
0bb7f6eeaa
commit
1eda1e65e9
10
pkgs/compatibility-pkgs/compatibility-test/LICENSE.txt
Normal file
10
pkgs/compatibility-pkgs/compatibility-test/LICENSE.txt
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
compatibility-lib
|
||||||
|
Copyright (c) 2010-2013 PLT Design Inc.
|
||||||
|
|
||||||
|
This package is distributed under the GNU Lesser General Public
|
||||||
|
License (LGPL). This means that you can link Racket into proprietary
|
||||||
|
applications, provided you follow the rules stated in the LGPL. You
|
||||||
|
can also modify this package; if you distribute a modified version,
|
||||||
|
you must distribute it under the terms of the LGPL, which in
|
||||||
|
particular means that you must release the source code for the
|
||||||
|
modified software. See COPYING_LESSER.txt for more information.
|
8
pkgs/compatibility-pkgs/compatibility-test/info.rkt
Normal file
8
pkgs/compatibility-pkgs/compatibility-test/info.rkt
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#lang info
|
||||||
|
(define collection 'multi)
|
||||||
|
(define deps '("base"
|
||||||
|
"racket-test"))
|
||||||
|
|
||||||
|
(define pkg-desc "tests for \"compatibility-lib\"")
|
||||||
|
|
||||||
|
(define pkg-authors '(mflatt))
|
|
@ -8,8 +8,8 @@
|
||||||
(define-syntax (test-awk stx)
|
(define-syntax (test-awk stx)
|
||||||
(syntax-case stx ()
|
(syntax-case stx ()
|
||||||
[(_ val body ...)
|
[(_ val body ...)
|
||||||
(with-syntax ([next (datum->syntax-object stx 'next)]
|
(with-syntax ([next (datum->syntax stx 'next)]
|
||||||
[result (datum->syntax-object stx 'result)])
|
[result (datum->syntax stx 'result)])
|
||||||
(syntax
|
(syntax
|
||||||
(let* ([p (open-input-string "Hello world.")]
|
(let* ([p (open-input-string "Hello world.")]
|
||||||
[next (lambda () (let ([o (read p)])
|
[next (lambda () (let ([o (read p)])
|
|
@ -0,0 +1,38 @@
|
||||||
|
|
||||||
|
(load-relative "loadtest.rktl")
|
||||||
|
|
||||||
|
(Section 'command-line)
|
||||||
|
|
||||||
|
(require mzlib/cmdline)
|
||||||
|
|
||||||
|
(test (void) 'cmdline
|
||||||
|
(command-line "something" #("-ab")
|
||||||
|
(once-each
|
||||||
|
[("-a") "ok" 5]
|
||||||
|
[("-b" "--more") "Help" 7])))
|
||||||
|
|
||||||
|
;; test that keywords are compared for the literal symbol
|
||||||
|
(test "foo" 'cmdline
|
||||||
|
(let ([once-each 3] [args "args"])
|
||||||
|
(command-line "something" #("-ab" "foo")
|
||||||
|
(once-each
|
||||||
|
[("-a") "ok" 5]
|
||||||
|
[("-b" "--more") "Help" 7])
|
||||||
|
(args (x) x))))
|
||||||
|
|
||||||
|
(syntax-test #'(command-line))
|
||||||
|
(syntax-test #'(command-line "hello"))
|
||||||
|
(err/rt-test (command-line 'hello #("ok")))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (bad)))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (once-any ())))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (once-any ("-ok"))))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (once-any ("-ok" "the ok flag"))))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (once-any ("-ok" a "the ok flag"))))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (once-any ("-ok" (a) "the ok flag"))))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (once-any ("-ok" a "the ok flag") ())))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (args 'done) (once-any ("-ok" a "the ok flag" 7))))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (args (ok) 'done) (once-any ("-ok" a "the ok flag" 7))))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (=> 'done) (once-any ("-ok" a "the ok flag" 7))))
|
||||||
|
(syntax-test #'(command-line "hello" #("ok") (=> 1 2 3 4) (once-any ("-ok" a "the ok flag" 7))))
|
||||||
|
|
||||||
|
(report-errs)
|
|
@ -49,5 +49,21 @@
|
||||||
(define goo 10)
|
(define goo 10)
|
||||||
12))
|
12))
|
||||||
|
|
||||||
|
(let ()
|
||||||
|
(test 3 (rec f (λ (x) 3)) 3)
|
||||||
|
(test 3 (rec f (λ (x) x)) 3)
|
||||||
|
(test 2 (rec f (λ (x) (if (= x 3) (f 2) x))) 3)
|
||||||
|
(test 3 (rec (f x) 3) 3)
|
||||||
|
(test 3 (rec (f x) x) 3)
|
||||||
|
(test 2 (rec (f x) (if (= x 3) (f 2) x)) 3)
|
||||||
|
(test 2 (rec (f x . y) (car y)) 1 2 3)
|
||||||
|
(test 2 'no-duplications
|
||||||
|
(let ([x 1]) (rec ignored (begin (set! x (+ x 1)) void)) x))
|
||||||
|
(test 'f object-name (rec (f x) x))
|
||||||
|
(test 'f object-name (rec (f x . y) x))
|
||||||
|
(test 'f object-name (rec f (lambda (x) x)))
|
||||||
|
(test (list 2) (rec (f . x) (if (= (car x) 3) (f 2) x)) 3))
|
||||||
|
|
||||||
|
|
||||||
(report-errs)
|
(report-errs)
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
(load (collection-file-path "loadtest.rktl" "tests/racket"))
|
|
@ -0,0 +1,16 @@
|
||||||
|
|
||||||
|
(load-relative "loadtest.rktl")
|
||||||
|
|
||||||
|
(Section 'serialization)
|
||||||
|
|
||||||
|
(module ser-mod mzscheme
|
||||||
|
(require mzlib/serialize)
|
||||||
|
(provide ser-mod-test)
|
||||||
|
|
||||||
|
(define-serializable-struct foo (a b))
|
||||||
|
|
||||||
|
(define (ser-mod-test)
|
||||||
|
(foo-a (deserialize (serialize (make-foo 1 2))))))
|
||||||
|
|
||||||
|
(require 'ser-mod)
|
||||||
|
(test 1 ser-mod-test)
|
|
@ -0,0 +1,4 @@
|
||||||
|
#lang racket/load
|
||||||
|
|
||||||
|
(define quiet-load (collection-file-path "tests.rktl" "tests" "mzlib"))
|
||||||
|
(load (collection-file-path "quiet.rktl" "tests" "racket"))
|
|
@ -0,0 +1 @@
|
||||||
|
(load (collection-file-path "testing.rktl" "tests/racket"))
|
|
@ -0,0 +1,17 @@
|
||||||
|
(load "loadtest.rktl")
|
||||||
|
|
||||||
|
(load-in-sandbox "kw.rktl")
|
||||||
|
(load-in-sandbox "awk.rktl")
|
||||||
|
(load-in-sandbox "etc.rktl")
|
||||||
|
(load-in-sandbox "compat.rktl")
|
||||||
|
(load-in-sandbox "unit.rktl")
|
||||||
|
(load-in-sandbox "unitsig.rktl")
|
||||||
|
(load-in-sandbox "string-mzlib.rktl")
|
||||||
|
(load-in-sandbox "threadlib.rktl")
|
||||||
|
(load-in-sandbox "serialize.rktl")
|
||||||
|
(load-in-sandbox "pconvert.rktl")
|
||||||
|
(load-in-sandbox "cmdline.rktl")
|
||||||
|
(load-in-sandbox "restart.rktl")
|
||||||
|
(load-in-sandbox "macrolib.rktl")
|
||||||
|
(load-in-sandbox "structlib.rktl")
|
||||||
|
(load-in-sandbox "contract-mzlib-test.rktl")
|
Loading…
Reference in New Issue
Block a user