Skip to content

Commit 98dfa7c

Browse files
Merge pull request #13 from aadcg/add-assert-string=
asserts: Add assert-string=.
2 parents fb97215 + 12eb4f9 commit 98dfa7c

File tree

1 file changed

+50
-1
lines changed

1 file changed

+50
-1
lines changed

asserts.lisp

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,56 @@ vice versa."
5050
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'equalp
5151
:full-form ',whole))
5252

53+
(defmacro assert-string= (&whole whole expected form &rest extras)
54+
"Assert whether expected and form are STRING=."
55+
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'string=
56+
:full-form ',whole))
57+
58+
(defmacro assert-string-equal (&whole whole expected form &rest extras)
59+
"Assert whether expected and form are STRING-EQUAL."
60+
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'string-equal
61+
:full-form ',whole))
62+
63+
(defmacro assert-string/= (&whole whole expected form &rest extras)
64+
"Assert whether expected and form are STRING/=."
65+
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'string/=
66+
:full-form ',whole))
67+
68+
(defmacro assert-string-not-equal (&whole whole expected form &rest extras)
69+
"Assert whether expected and form are STRING-NOT-EQUAL."
70+
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'string-not-equal
71+
:full-form ',whole))
72+
73+
(defmacro assert-char= (&whole whole expected form &rest extras)
74+
"Assert whether expected and form are CHAR=."
75+
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'char=
76+
:full-form ',whole))
77+
78+
(defmacro assert-char-equal (&whole whole expected form &rest extras)
79+
"Assert whether expected and form are CHAR-EQUAL."
80+
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'char-equal
81+
:full-form ',whole))
82+
83+
(defmacro assert-char/= (&whole whole expected form &rest extras)
84+
"Assert whether expected and form are CHAR/=."
85+
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'char/=
86+
:full-form ',whole))
87+
88+
(defmacro assert-char-not-equal (&whole whole expected form &rest extras)
89+
"Assert whether expected and form are CHAR-NOT-EQUAL."
90+
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'char-not-equal
91+
:full-form ',whole))
92+
93+
(defmacro assert= (&whole whole expected form &rest extras)
94+
"Assert whether expected and form are =."
95+
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'=
96+
:full-form ',whole))
97+
98+
(defmacro assert/= (&whole whole expected form &rest extras)
99+
"Assert whether expected and form are /=."
100+
`(expand-assert 'equal-result ,form ,form ,expected ,extras :test #'/=
101+
:full-form ',whole))
102+
53103
(defmacro assert-typep (&whole whole expected-type form &rest extras)
54104
"Assert whether expected and form are TYPEP."
55105
`(expand-assert
@@ -267,4 +317,3 @@ vice versa."
267317
(defmacro with-failure-debugging (() &body body)
268318
"A context macro that invokes the debugger on failed assertions"
269319
`(with-failure-debugging-context (lambda () ,@body)))
270-

0 commit comments

Comments
 (0)