private/tests/tests.ss
(module tests mzscheme
  (require (planet "test.ss" ("schematics" "schemeunit.plt" 1)))
  (require (planet "text-ui.ss" ("schematics" "schemeunit.plt" 1)))
  (require "../../test.ss")

  (define-syntax make-permutation-test
    (syntax-rules ()
      [(_ assertion (syms1 ...) (syms2 ...))
       (make-test-case "permutation test"
                       (assert-eq? (list-permutation? '(syms1 ...) '(syms2 ...)) assertion))]))

  (define all-tests
    (make-test-suite
     "all tests"
     ;; both empty:
     (make-permutation-test #t () ())

     ;; all combinations of three
     (make-permutation-test #t (a b c) (c b a))
     (make-permutation-test #t (a b c) (c a b))
     (make-permutation-test #t (a b c) (b c a))
     (make-permutation-test #t (a b c) (b a c))
     (make-permutation-test #t (a b c) (a b c))
     (make-permutation-test #t (a b c) (a c b))

     ;; with an extra element, including all duplicates:
     (make-permutation-test #f (a b c) (a b c d))
     (make-permutation-test #f (a b c) (a b c a))
     (make-permutation-test #f (a b c) (a b c b))
     (make-permutation-test #f (a b c) (a b c c))

     ;; now backwards:
     (make-permutation-test #t (c b a) (a b c))
     (make-permutation-test #t (c a b) (a b c))
     (make-permutation-test #t (b c a) (a b c))
     (make-permutation-test #t (b a c) (a b c))
     (make-permutation-test #t (a b c) (a b c))
     (make-permutation-test #t (a c b) (a b c))
     (make-permutation-test #f (a b c d) (a b c))
     (make-permutation-test #f (a b c a) (a b c))
     (make-permutation-test #f (a b c b) (a b c))
     (make-permutation-test #f (a b c c) (a b c))

     ;; one empty:
     (make-permutation-test #f (a b c) ())
     (make-permutation-test #f () (a b c))
     ))

  (test/text-ui all-tests))