]> git.donarmstrong.com Git - lilypond.git/blob - guile18/test-suite/standalone/test-asmobs
New upstream version 2.19.65
[lilypond.git] / guile18 / test-suite / standalone / test-asmobs
1 #!/bin/sh
2 exec guile -q -s "$0" "$@"
3 !#
4
5 (load-extension (string-append (getenv "builddir") "/libtest-asmobs")
6                 "libtest_asmobs_init")
7
8 (define (test x v)
9   (if v
10       (if (not (equal? (eval x (current-module)) v))
11           (error "Wrong return value" x))
12       (catch #t
13              (lambda ()
14                (begin (eval x (current-module))
15                       (throw 'should-be-error)))
16              (lambda (key . args)
17                (if (eq? key 'should-be-error)
18                    (error "Should be error" x))))))
19
20 (define asmob000 (make-asmob000))
21 (test '(asmob000) '())
22 (test '(asmob000 1) #f)
23 (test '(asmob000 1 2) #f)
24 (test '(asmob000 1 2 3) #f)
25
26 (define asmob100 (make-asmob100))
27 (test '(asmob100) #f)
28 (test '(asmob100 1) '(1))
29 (test '(asmob100 1 2) #f)
30 (test '(asmob100 1 2 3) #f)
31
32 (define asmob010 (make-asmob010))
33 (test '(asmob010) '(#f))
34 (test '(asmob010 1) '(1))
35 (test '(asmob010 1 2) #f)
36 (test '(asmob010 1 2 3) #f)
37
38 (define asmob001 (make-asmob001))
39 (test '(asmob001) '(()))
40 (test '(asmob001 1) '((1)))
41 (test '(asmob001 1 2) '((1 2)))
42 (test '(asmob001 1 2 3) '((1 2 3)))
43
44 (define asmob200 (make-asmob200))
45 (test '(asmob200) #f)
46 (test '(asmob200 1) #f)
47 (test '(asmob200 1 2) '(1 2))
48 (test '(asmob200 1 2 3) #f)
49
50 (define asmob110 (make-asmob110))
51 (test '(asmob110) #f)
52 (test '(asmob110 1) '(1 #f))
53 (test '(asmob110 1 2) '(1 2))
54 (test '(asmob110 1 2 3) #f)
55
56 (define asmob020 (make-asmob020))
57 (test '(asmob020) '(#f #f))
58 (test '(asmob020 1) '(1 #f))
59 (test '(asmob020 1 2) '(1 2))
60 (test '(asmob020 1 2 3) #f)
61
62 (define asmob101 (make-asmob101))
63 (test '(asmob101) #f)
64 (test '(asmob101 1) '(1 ()))
65 (test '(asmob101 1 2) '(1 (2)))
66 (test '(asmob101 1 2 3) '(1 (2 3)))
67
68 (define asmob011 (make-asmob011))
69 (test '(asmob011) '(#f ()))
70 (test '(asmob011 1) '(1 ()))
71 (test '(asmob011 1 2) '(1 (2)))
72 (test '(asmob011 1 2 3) '(1 (2 3)))
73
74 (define asmob300 (make-asmob300))
75 (test '(asmob300) #f)
76 (test '(asmob300 1) #f)
77 (test '(asmob300 1 2) #f)
78 (test '(asmob300 1 2 3) '(1 2 3))
79
80 (define asmob210 (make-asmob210))
81 (test '(asmob210) #f)
82 (test '(asmob210 1) #f)
83 (test '(asmob210 1 2) '(1 2 #f))
84 (test '(asmob210 1 2 3) '(1 2 3))
85
86 (define asmob120 (make-asmob120))
87 (test '(asmob120) #f)
88 (test '(asmob120 1) '(1 #f #f))
89 (test '(asmob120 1 2) '(1 2 #f))
90 (test '(asmob120 1 2 3) '(1 2 3))
91
92 (define asmob030 (make-asmob030))
93 (test '(asmob030) '(#f #f #f))
94 (test '(asmob030 1) '(1 #f #f))
95 (test '(asmob030 1 2) '(1 2 #f))
96 (test '(asmob030 1 2 3) '(1 2 3))
97
98 (define asmob201 (make-asmob201))
99 (test '(asmob201) #f)
100 (test '(asmob201 1) #f)
101 (test '(asmob201 1 2) '(1 2 ()))
102 (test '(asmob201 1 2 3) '(1 2 (3)))
103
104 (define asmob021 (make-asmob021))
105 (test '(asmob021) '(#f #f ()))
106 (test '(asmob021 1) '(1 #f ()))
107 (test '(asmob021 1 2) '(1 2 ()))
108 (test '(asmob021 1 2 3) '(1 2 (3)))
109
110 (define asmob111 (make-asmob111))
111 (test '(asmob111) #f)
112 (test '(asmob111 1) '(1 #f ()))
113 (test '(asmob111 1 2) '(1 2 ()))
114 (test '(asmob111 1 2 3) '(1 2 (3)))
115
116 ;; Local Variables:
117 ;; mode: scheme
118 ;; End: