move assertEquals to language core
This commit is contained in:
@@ -386,6 +386,12 @@ class Macros {
|
||||
}
|
||||
};
|
||||
|
||||
k.doc("assertEquals", 2, null, "(assertEquals <expected> <actual> <?more actual...>)");
|
||||
macros["assertEquals"] = (wholeExp:ReaderExp, exps:Array<ReaderExp>, k:KissState) -> {
|
||||
var b = wholeExp.expBuilder();
|
||||
b.callSymbol("assert", [b.callSymbol("=", exps)]);
|
||||
}
|
||||
|
||||
function stringsThatMatch(exp:ReaderExp, formName:String) {
|
||||
return switch (exp.def) {
|
||||
case StrExp(s):
|
||||
|
||||
@@ -341,7 +341,8 @@
|
||||
From:[(assert false (+ \"false \" \"should \" \"have \" \"been \" \"true\"))]" message)))
|
||||
|
||||
(assert true)
|
||||
(assert ![]))
|
||||
(assert ![])
|
||||
(assertEquals 6 6 6))
|
||||
|
||||
(function _testApply []
|
||||
(Assert.equals 6 (apply + [1 2 3])))
|
||||
|
||||
@@ -9,7 +9,4 @@
|
||||
,@body))
|
||||
|
||||
(defMacro dayTodo [num]
|
||||
`(day ,num (print "TODO")))
|
||||
|
||||
(defMacro assertEquals [expected actual]
|
||||
`(assert (= ,expected ,actual)))
|
||||
`(day ,num (print "TODO")))
|
||||
Reference in New Issue
Block a user