3 echo ' ()' | cat $($(dirname $0)/../scripts/include.mes $0) $0 /dev/stdin | $(dirname $0)/../scripts/mes "$@"
10 ;;; Mes --- Maxwell Equations of Software
11 ;;; Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
13 ;;; vector.test: This file is part of Mes.
15 ;;; Mes is free software; you can redistribute it and/or modify it
16 ;;; under the terms of the GNU General Public License as published by
17 ;;; the Free Software Foundation; either version 3 of the License, or (at
18 ;;; your option) any later version.
20 ;;; Mes is distributed in the hope that it will be useful, but
21 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
22 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 ;;; GNU General Public License for more details.
25 ;;; You should have received a copy of the GNU General Public License
26 ;;; along with Mes. If not, see <http://www.gnu.org/licenses/>.
28 (mes-use-module (mes base-0))
29 (mes-use-module (mes base))
30 (mes-use-module (mes quasiquote))
31 (mes-use-module (mes let))
32 (mes-use-module (srfi srfi-0))
33 (mes-use-module (mes scm))
34 (mes-use-module (mes test))
37 (use-modules (srfi srfi-1)))
39 (pass-if "first dummy" #t)
40 (pass-if-not "second dummy" #f)
42 (pass-if "vector" (sequal? #(vector 0 1 2) #(vector 0 1 2)))
43 (pass-if "vector?" (vector? #(1 2 c)))
44 (pass-if "vector-length" (seq? (vector-length #(1)) 1))
47 (pass-if "c:make-vector" (sequal? (c:make-vector 3) #(*unspecified* *unspecified* *unspecified*)))
48 (pass-if "make-vector" (sequal? (make-vector 3) #(*unspecified* *unspecified* *unspecified*))))
50 (pass-if "make-vector 2" (sequal? (make-vector 3 1) #(1 1 1)))
51 (pass-if "vector-ref" (seq? (vector-ref #(0 1) 1) 1))
52 (pass-if "vector-set!" (equal? (let ((v #(0 1))) (vector-set! v 1 'q) v) #(0 q)))
53 (pass-if "vector-set! 2" (not (equal? (let ((v #(0 1))) (vector-set! v 1 'q) v) #())))
54 (pass-if "vector-set! 3" (sequal? (let ((v1 #(0))
56 (vector-set! v2 0 (cons 0 (vector-ref v1 0)))
57 (vector-set! v1 0 'mwhuharhararrrg)
60 (pass-if "list->vector" (sequal? (list->vector '(a b c)) #(a b c)))
61 (pass-if "vector list" (let* ((v #(0))
65 (sequal? (vector->list v) '((a)))))