test-simple-join-forest.ss
(module test-simple-join-forest mzscheme
  (require (planet "test.ss" ("schematics" "schemeunit.plt" 2 8))
           (planet "text-ui.ss" ("schematics" "schemeunit.plt" 2 8))
           "simple-join-forest.ss")
  
  (define simple-join-forest-test
    (test-suite
     "simple-join-forest.ss"
     (test-case
      "empty case should raise contract error"
      (check-exn exn:fail:contract? (lambda () (join-forest '() list))))
     
     (test-case
      "unary case"
      (check-equal? (join-forest '(x) list)
                    'x))
     
     (test-case
      "binary case"
      (check-equal? (join-forest '(x y) list)
                    '(x y)))
     
     (test-case
      "tri case"
      (check-equal? (join-forest '(a b c) list)
                    '((a b) c)))
     
     (test-case
      "quad case"
      (check-equal? (join-forest '(a b c d) list)
                    '((a b) (c d))))
     
     (test-case
      "8"
      (check-equal? (join-forest '(1 2 3 4 5 6 7 8) list)
                    '(((1 2) (3 4)) ((5 6) (7 8)))))))
  
  (test/text-ui simple-join-forest-test))