-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsymbol-test.lisp
45 lines (34 loc) · 1.48 KB
/
symbol-test.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
;;; Copyright 2020 Google LLC
;;;
;;; Use of this source code is governed by an MIT-style
;;; license that can be found in the LICENSE file or at
;;; https://opensource.org/licenses/MIT.
;;;;
;;;; Test for macro helpers
;;;;
(ace.core.package:defpackage* #:ace.core.symbol-test
(:use #:common-lisp
#:ace.test)
(:use-alias (#:symbol #:ace.core.symbol)))
(in-package #:ace.core.symbol-test)
(deftest cat-test ()
(let ((*package* (symbol-package 'cat-test)))
(expect (eq 'test (symbol:cat t :test)))
(expect (eq 'test-me (symbol:cat t :test :-me)))
(expect (eq 'test-me* (symbol:cat t :test :-me #\*)))
(expect (eq 'test (symbol:cat! :test)))
(expect (eq 'test-me (symbol:cat! :test :-me)))
(expect (eq 'test-me* (symbol:cat! :test :-me #\*)))
(expect (eq :test (symbol:cat* :test)))
(expect (eq :test-me (symbol:cat* :test :-me)))
(expect (eq :test-me* (symbol:cat* :test :-me #\*)))
(expect (eq 'test-me (symbol:cat$ :test- 'me)))
(expect (eq 'test-me* (symbol:cat$ :test '-me #\*)))
(expect (null (symbol-package (symbol:cat nil :test))))))
(deftest test-format! ()
(expect (eq 'test (symbol:format! "TEST")))
(expect (eq 'test-symbol (symbol:format! "TEST-~A" 'symbol)))
(expect (eq 'test-a-b-c (symbol:format! "TEST~{-~A~}" '(a b c)))))
(deftest test-format* ()
(expect (eq 'symbol::test-format* (symbol:format* "TEST-~A" 'symbol:format*)))
(expect (eq 'test-a-b-fixnum-d (symbol:format* "TEST~A~{-~A~}" '-a '(b fixnum #:|D|)))))