nendo 0.6.8 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/test/srfi-2-test.nnd DELETED
@@ -1,63 +0,0 @@
1
- ;;-*- mode: nendo; syntax: scheme -*-;;
2
- ;;
3
- ;; srfi-2-test.nnd - test suite for srfi-2
4
- ;;
5
- ;; Copyright (c) 2000-2010 Shiro Kawai <shiro@acm.org>
6
- ;;
7
- ;; Redistribution and use in source and binary forms, with or without
8
- ;; modification, are permitted provided that the following conditions
9
- ;; are met:
10
- ;;
11
- ;; 1. Redistributions of source code must retain the above copyright
12
- ;; notice, this list of conditions and the following disclaimer.
13
- ;;
14
- ;; 2. Redistributions in binary form must reproduce the above copyright
15
- ;; notice, this list of conditions and the following disclaimer in the
16
- ;; documentation and/or other materials provided with the distribution.
17
- ;;
18
- ;; 3. Neither the name of the authors nor the names of its contributors
19
- ;; may be used to endorse or promote products derived from this
20
- ;; software without specific prior written permission.
21
- ;;
22
- ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
- ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
- ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
- ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
- ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
- ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
28
- ;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29
- ;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30
- ;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31
- ;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32
- ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
-
34
-
35
- (use nendo.test)
36
- (test-start "srfi-2 (and-let*)")
37
-
38
- ;;===================================================================
39
- ;;-------------------------------------------------------------------
40
- (test-section "srfi-2")
41
- (use srfi-2)
42
- (test-module 'srfi-2)
43
-
44
- (define (srfi-2-look-up key alist)
45
- (and-let* ((x (assq key alist))) (cdr x)))
46
- (test* "and-let*" 3
47
- (srfi-2-look-up 'c '((a . 1) (b . 2) (c . 3))))
48
- (test* "and-let*" #f
49
- (srfi-2-look-up 'd '((a . 1) (b . 2) (c . 3))))
50
- (test* "and-let*" 3
51
- (let ((x 3))
52
- (and-let* (((positive? x))
53
- (y x))
54
- y)))
55
- (test* "and-let*" #f
56
- (let ((x -3))
57
- (and-let* (((positive? x))
58
- (y x))
59
- y)))
60
-
61
-
62
- ;;===================================================================
63
- (test-end)
@@ -1,89 +0,0 @@
1
- ;;-*- mode: nendo; syntax: scheme -*-;;
2
- ;;
3
- ;; srfi-26-test.nnd - Test suite for srfi-26
4
- ;;
5
- ;; Copyright (c) 2000-2010 Shiro Kawai <shiro@acm.org>
6
- ;;
7
- ;; Redistribution and use in source and binary forms, with or without
8
- ;; modification, are permitted provided that the following conditions
9
- ;; are met:
10
- ;;
11
- ;; 1. Redistributions of source code must retain the above copyright
12
- ;; notice, this list of conditions and the following disclaimer.
13
- ;;
14
- ;; 2. Redistributions in binary form must reproduce the above copyright
15
- ;; notice, this list of conditions and the following disclaimer in the
16
- ;; documentation and/or other materials provided with the distribution.
17
- ;;
18
- ;; 3. Neither the name of the authors nor the names of its contributors
19
- ;; may be used to endorse or promote products derived from this
20
- ;; software without specific prior written permission.
21
- ;;
22
- ;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23
- ;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24
- ;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
25
- ;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
26
- ;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
27
- ;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
28
- ;; TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29
- ;; PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30
- ;; LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31
- ;; NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
32
- ;; SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33
-
34
-
35
- (use nendo.test)
36
- (test-start "srfi-26 (cut cute)")
37
-
38
- ;;===================================================================
39
- ;;-------------------------------------------------------------------
40
- (test-section "srfi-26")
41
- (use srfi-26)
42
- (test-module 'srfi-26)
43
-
44
- ;; The test cases are taken from the SRFI-26 test program by Sebastian Egner.
45
- (test* "cut list" '() ((cut list)))
46
- (test* "cut list <...>" '() ((cut list <...>)))
47
- (test* "cut list 1" '(1) ((cut list 1)))
48
- (test* "cut list <>" '(1) ((cut list <>) 1))
49
- (test* "cut list <...>" '(1) ((cut list <...>) 1))
50
- (test* "cut list 1 2" '(1 2) ((cut list 1 2)))
51
- (test* "cut list 1 <>" '(1 2) ((cut list 1 <>) 2))
52
- (test* "cut list 1 <...>" '(1 2) ((cut list 1 <...>) 2))
53
- (test* "cut list 1 <...>" '(1 2 3 4) ((cut list 1 <...>) 2 3 4))
54
- (test* "cut list 1 <> 3 <>" '(1 2 3 4) ((cut list 1 <> 3 <>) 2 4))
55
- (test* "cut list 1 <> 3 <...>" '(1 2 3 4 5 6) ((cut list 1 <> 3 <...>) 2 4 5 6))
56
- ;;
57
- ;; FIXME!: these test was pending. (by Kiyoka Nishiyama)
58
- ;; because it doesn't pass `cut' syntax from chibi-scheme-0.3
59
- ;;
60
- ;;(test* "cut (eval order)" '(ok)
61
- ;; (let* ((x 'wrong) (y (cut list x))) (set! x 'ok) (y)))
62
- ;;(test* "cut (eval order)" 2
63
- ;; (let ((a 0))
64
- ;; (map (cut + (begin (set! a (+ a 1)) a) <>)
65
- ;; '(1 2))
66
- ;; a))
67
-
68
- (test* "cute list" '() ((cute list)))
69
- (test* "cute list <...>" '() ((cute list <...>)))
70
- (test* "cute list 1" '(1) ((cute list 1)))
71
- (test* "cute list <>" '(1) ((cute list <>) 1))
72
- (test* "cute list <...>" '(1) ((cute list <...>) 1))
73
- (test* "cute list 1 2" '(1 2) ((cute list 1 2)))
74
- (test* "cute list 1 <>" '(1 2) ((cute list 1 <>) 2))
75
- (test* "cute list 1 <...>" '(1 2) ((cute list 1 <...>) 2))
76
- (test* "cute list 1 <...>" '(1 2 3 4) ((cute list 1 <...>) 2 3 4))
77
- (test* "cute list 1 <> 3 <>" '(1 2 3 4) ((cute list 1 <> 3 <>) 2 4))
78
- (test* "cute list 1 <> 3 <...>" '(1 2 3 4 5 6) ((cute list 1 <> 3 <...>) 2 4 5 6))
79
- (test* "cute (eval order)" '(ok)
80
- (let* ((x 'ok) (y (cute list x))) (set! x 'wrong) (y)))
81
- (test* "cute (eval order)" 1
82
- (let ((a 0))
83
- (map (cute + (begin (set! a (+ a 1)) a) <>)
84
- '(1 2))
85
- a))
86
-
87
-
88
- ;;===================================================================
89
- (test-end)