File: test-script.scm

package info (click to toggle)
slib 3c1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,076 kB
  • sloc: lisp: 29,815; makefile: 1,165; sh: 953
file content (38 lines) | stat: -rw-r--r-- 889 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
;;
;; Some trivial tests of SLIB procedures.
;;

(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 42 (identity 42) "identity")

;;; This errors out on mit-scheme for some reason
;;; TODO: investigate
(if (not (eq? (scheme-implementation-type) 'MITScheme))
    (begin
      (require 'yasos)

      (assert-equal 2 (size '(1 2)) "yasos size")
      (assert-equal 2 (size '(1 . 2)) "yasos size")
      (assert-equal 5 (size "hello") "yasos size")))
      
(require 'format)

(assert-equal "hello 80 VI" (format #f "~A ~X ~@R" "hello" 128 6) "format")

(slib:exit 0)