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) {
|
function stringsThatMatch(exp:ReaderExp, formName:String) {
|
||||||
return switch (exp.def) {
|
return switch (exp.def) {
|
||||||
case StrExp(s):
|
case StrExp(s):
|
||||||
|
@@ -341,7 +341,8 @@
|
|||||||
From:[(assert false (+ \"false \" \"should \" \"have \" \"been \" \"true\"))]" message)))
|
From:[(assert false (+ \"false \" \"should \" \"have \" \"been \" \"true\"))]" message)))
|
||||||
|
|
||||||
(assert true)
|
(assert true)
|
||||||
(assert ![]))
|
(assert ![])
|
||||||
|
(assertEquals 6 6 6))
|
||||||
|
|
||||||
(function _testApply []
|
(function _testApply []
|
||||||
(Assert.equals 6 (apply + [1 2 3])))
|
(Assert.equals 6 (apply + [1 2 3])))
|
||||||
|
Reference in New Issue
Block a user