#lang scheme
(require "pa1.ss" (planet "test.ss" ("schematics" "schemeunit.plt" 2 10)))
(require (planet "text-ui.ss" ("schematics" "schemeunit.plt" 2 10)))
; When first you run this, it will fetch and install SchemeUnit automatically.
; SchemeUnit documentation can be found at the following URL:
; http://planet.plt-scheme.org/package-source/schematics/schemeunit.plt/2/10/doc.txt

(define pa1-tests
  (test-suite
   "pa1"
   (test-equal? "list-head" (list-head '(a b c) 2) '(a b))
   (test-equal? "split-position" (split-position '(a b c)) 1)
   (test-equal? "first-half" (first-half '(a b c)) '(a))
   (test-equal? "second-half" (second-half '(a b c)) '(b c))
   (test-equal? "merge" (merge < '(1 3) '(2 4)) '(1 2 3 4))
   (test-equal? "merge-sort" (merge-sort < '(4 3 2 1)) '(1 2 3 4))
   (test-equal? "sort-numbers-decreasing"
                (sort-numbers-decreasing  '(1 2 3 4)) '(4 3 2 1))
   (test-equal? "sort-strings-increasing"
                (apply string-append
                 (sort-strings-increasing  '("job " "mate!" "Good ")))
                "Good job mate!")))

(test/text-ui pa1-tests)
