Commit | Line | Data |
---|---|---|
2948fc75 KR |
1 | /* test-list.c - exercise libguile/list.c functions */ |
2 | ||
3 | /* Copyright (C) 2006 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 2.1 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 | ||
20 | #include "libguile.h" | |
21 | ||
22 | #include <stdio.h> | |
23 | #include <assert.h> | |
24 | #include <string.h> | |
25 | ||
26 | /* pretty trivial, but ensure this entrypoint exists, since it was | |
27 | documented in Guile 1.6 and earlier */ | |
28 | static void | |
29 | test_scm_list (void) | |
30 | { | |
31 | { | |
32 | if (! scm_is_eq (SCM_EOL, scm_list (SCM_EOL))) | |
33 | { | |
34 | fprintf (stderr, "fail: scm_list SCM_EOL\n"); | |
35 | exit (1); | |
36 | } | |
37 | } | |
38 | ||
39 | { | |
40 | SCM lst = scm_list_2 (scm_from_int (1), scm_from_int (2)); | |
41 | if (! scm_is_true (scm_equal_p (lst, scm_list (lst)))) | |
42 | { | |
43 | fprintf (stderr, "fail: scm_list '(1 2)\n"); | |
44 | exit (1); | |
45 | } | |
46 | } | |
47 | } | |
48 | ||
8ab3d8a0 KR |
49 | static void |
50 | tests (void *data, int argc, char **argv) | |
2948fc75 | 51 | { |
2948fc75 | 52 | test_scm_list (); |
8ab3d8a0 KR |
53 | } |
54 | ||
55 | int | |
56 | main (int argc, char *argv[]) | |
57 | { | |
58 | scm_boot_guile (argc, argv, tests, NULL); | |
2948fc75 KR |
59 | return 0; |
60 | } |