Fast generic function dispatch without calling `compile' at runtime
[bpt/guile.git] / test-suite / tests / 00-initial-env.test
CommitLineData
cedf24d8
LC
1;;;; 00-initial-env.test --- Roots. -*- mode: scheme; coding: utf-8; -*-
2;;;;
3;;;; Copyright (C) 2010 Free Software Foundation, Inc.
4;;;;
5;;;; This library is free software; you can redistribute it and/or
6;;;; modify it under the terms of the GNU Lesser General Public
7;;;; License as published by the Free Software Foundation; either
8;;;; version 3 of the License, or (at your option) any later version.
9;;;;
10;;;; This library is distributed in the hope that it will be useful,
11;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
12;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13;;;; Lesser General Public License for more details.
14;;;;
15;;;; You should have received a copy of the GNU Lesser General Public
16;;;; License along with this library; if not, write to the Free Software
17;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
19(define-module (the-initial-env)
20 #:use-module (test-suite lib))
21
22;;; A set of tests to run early. The file name is to have `check-guile' pick
23;;; this test file first.
24
25\f
26;;;
27;;; Tests to be run when GOOPS is not loaded.
28;;;
29
30(with-test-prefix "goopsless"
31
0c57673a 32 (with-test-prefix/c&e "+ wrong type argument"
cedf24d8
LC
33
34 ;; The following tests assume that `+' hasn't been turned into a generic
35 ;; and extended. Since the ECMAScript run-time library does exactly
36 ;; that, they must be run before `ecmascript.test'.
37
38 (pass-if-exception "1st argument string"
39 exception:wrong-type-arg
40 (+ "1" 2))
41
42 (pass-if-exception "2nd argument bool"
43 exception:wrong-type-arg
28828f40
LC
44 (+ 1 #f))
45
46 (pass-if-exception "implicit forcing is not supported"
47 exception:wrong-type-arg
0c57673a
LC
48 (+ (delay (* 3 7)) 13)))
49
50 (with-test-prefix/c&e "- wrong type argument"
51
52 ;; Same for `-'.
53
54 (pass-if-exception "1st argument string"
55 exception:wrong-type-arg
56 (+ "1" 2))
57
58 (pass-if-exception "2nd argument symbol"
59 exception:wrong-type-arg
60 (+ 1 'bar))))