e7c5f95a |
1 | (in-package :lol-test) |
2 | |
3 | (defsuite lisp-on-lines) |
4 | |
5 | (in-suite lisp-on-lines) |
6 | |
7 | (defclass lol-test-class () |
8 | ((string-slot |
9 | :accessor string-slot |
10 | :initform "test" |
11 | :type string) |
12 | (number-slot |
13 | :accessor number-slot |
14 | :initform 12345 |
15 | :type number) |
16 | (symbol-slot |
17 | :accessor symbol-slot |
18 | :initform 'symbol |
19 | :type symbol))) |
20 | |
21 | (deftest test-simple-define-description () |
22 | (eval '(lol:define-description test-description () |
23 | ((test-attribute :label "BRILLANT!")))) |
24 | |
25 | (eval '(deflayer test-description-layer)) |
26 | |
27 | (eval '(lol:define-description test-description () |
28 | ((test-attribute :label "BRILLANT-IN-LAYER")) |
29 | (:in-layer . test-description-layer)))) |
30 | |
31 | (deftest test-T-description () |
32 | (let ((d (find-description t))) |
33 | (is (find-attribute d 'identity)))) |
34 | |
35 | (deftest test-simple-attributes () |
36 | (test-simple-define-description) |
37 | (let* ((desc (find-description 'test-description)) |
38 | (att (find-attribute desc 'test-attribute))) |
39 | (is (equal "BRILLANT!" (slot-value att 'lol::label))) |
40 | (with-active-layers (test-description-layer) |
41 | (is (equal "BRILLANT-IN-LAYER" (slot-value att 'lol::label)))))) |
42 | |
e7c5f95a |
43 | (defparameter *atomic-type-specifiers* |
44 | '(arithmetic-error function simple-condition |
45 | array generic-function simple-error |
46 | atom hash-table simple-string |
47 | base-char integer simple-type-error |
48 | base-string keyword simple-vector |
49 | bignum list simple-warning |
50 | bit logical-pathname single-float |
51 | bit-vector long-float standard-char |
52 | broadcast-stream method standard-class |
53 | built-in-class method-combination standard-generic-function |
54 | cell-error nil standard-method |
55 | character null standard-object |
56 | class number storage-condition |
57 | compiled-function package stream |
58 | complex package-error stream-error |
59 | concatenated-stream parse-error string |
60 | condition pathname string-stream |
61 | cons print-not-readable structure-class |
62 | control-error program-error structure-object |
63 | division-by-zero random-state style-warning |
64 | double-float ratio symbol |
65 | echo-stream rational synonym-stream |
66 | end-of-file reader-error t |
67 | error readtable two-way-stream |
68 | extended-char real type-error |
69 | file-error restart unbound-slot |
70 | file-stream sequence unbound-variable |
71 | fixnum serious-condition undefined-function |
72 | float short-float unsigned-byte |
73 | floating-point-inexact signed-byte vector |
74 | floating-point-invalid-operation simple-array warning |
75 | floating-point-overflow simple-base-string |
76 | floating-point-underflow simple-bit-vector)) |
77 | |
78 | (deftest test-basic-types-description-of () |
79 | (let* ((symbol 'symbol) |
80 | (string "string") |
81 | (number 0) |
82 | (list (list symbol string number))))) |
83 | |
84 | |
85 | |
86 | |
87 | |
88 | |
89 | |