;;
;; Some trivial tests of SLIB procedures, for Racket's mzscheme.
;;
;; This is a cut-down version of test-script.scm: Racket pairs are
;; immutable, so every SLIB feature needing SET-CAR!/SET-CDR! (yasos
;; among them) is out of reach here.  FORMAT is skipped too: mzscheme.init
;; lists it as an implementation feature, so (require 'format) leaves
;; Racket's own SRFI-28 FORMAT in place rather than loading SLIB's.
;;

(define (assert-equal x y msg)
  (if (not (equal? x y))
      (begin
        (write `(equal? ,x ,y))
        (newline)
        (slib:error msg))))

(require 'printf)

(assert-equal #t (provided? 'printf) "provided?")

(printf "Hello, World!\n")

(assert-equal #t (string? (home-vicinity)) "home-vicinity")

(assert-equal 'unix (software-type) "software-type")

(assert-equal '|MzScheme| (scheme-implementation-type) "scheme-implementation-type")

(assert-equal 42 (identity 42) "identity")

(require 'string-search)

(assert-equal 2 (string-index "abcd" #\c) "string-index")

(require 'common-list-functions)

(assert-equal '(2 4) (remove-if odd? '(1 2 3 4)) "remove-if")

(slib:exit 0)
