bugfix generative test case
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
(defMacroVar maxExps 4)
|
(defMacroVar maxExps 4)
|
||||||
|
|
||||||
(defMacroFunction _macroList [func length]
|
(defMacroFunction _macroList [func length]
|
||||||
~(for _ (range length) (func)))
|
(for _ (range length) (func)))
|
||||||
|
|
||||||
(defMacro macroRepeat [exp length]
|
(defMacro macroRepeat [exp length]
|
||||||
`(begin ,@(_macroList ->{exp} (eval length))))
|
`(begin ,@(_macroList ->{exp} (eval length))))
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
(_macroList func (+ 2 (random (- maxExps 2)))))
|
(_macroList func (+ 2 (random (- maxExps 2)))))
|
||||||
|
|
||||||
(defMacroFunction _randomLetterString []
|
(defMacroFunction _randomLetterString []
|
||||||
(ReaderExp.StrExp (apply + (for _ (range (random maxStringLength)) (chooseRandom (.split "abcdefghijklmnopqrstuvwxyz" ""))))))
|
(ReaderExp.StrExp (apply + (for _ (range (+ 1 (random (- maxStringLength 1)))) (chooseRandom (.split "abcdefghijklmnopqrstuvwxyz" ""))))))
|
||||||
|
|
||||||
(defMacroFunction _randomFalsyExp []
|
(defMacroFunction _randomFalsyExp []
|
||||||
((chooseRandom
|
((chooseRandom
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
->{`(or ,@(_randomLengthMacroList _randomFalsyExp))}
|
->{`(or ,@(_randomLengthMacroList _randomFalsyExp))}
|
||||||
->{`(and
|
->{`(and
|
||||||
,@(_randomLengthMacroList _randomUncertainExp)
|
,@(_randomLengthMacroList _randomUncertainExp)
|
||||||
(_randomFalsyExp)
|
,(_randomFalsyExp)
|
||||||
,@(_randomLengthMacroList _randomUncertainExp))}
|
,@(_randomLengthMacroList _randomUncertainExp))}
|
||||||
])))
|
])))
|
||||||
(defMacro randomFalsyExp []
|
(defMacro randomFalsyExp []
|
||||||
@@ -46,10 +46,10 @@
|
|||||||
->(_randomTruthyExp)
|
->(_randomTruthyExp)
|
||||||
])))
|
])))
|
||||||
(defMacro randomUncertainExp []
|
(defMacro randomUncertainExp []
|
||||||
~(_randomUncertainExp))
|
(_randomUncertainExp))
|
||||||
|
|
||||||
(function _testTruthy []
|
(function _testTruthy []
|
||||||
(macroRepeat (Assert.isTrue ?(randomTruthyExp)) maxExps))
|
(macroRepeat (Assert.isTrue ?(randomTruthyExp)) 10))
|
||||||
|
|
||||||
(function _testFalsy []
|
(function _testFalsy []
|
||||||
(macroRepeat (Assert.isFalse ?(randomFalsyExp)) maxExps))
|
(macroRepeat (Assert.isFalse ?(randomFalsyExp)) 10))
|
@@ -26,8 +26,8 @@
|
|||||||
(doFor [name type] argPairs
|
(doFor [name type] argPairs
|
||||||
(untypedArgs.push name)
|
(untypedArgs.push name)
|
||||||
(letBindings.push name)
|
(letBindings.push name)
|
||||||
(print type)
|
// (print type)
|
||||||
(print name)
|
// (print name)
|
||||||
(letBindings.push `(the ,type ,name)))
|
(letBindings.push `(the ,type ,name)))
|
||||||
(print letBindings)
|
(print letBindings)
|
||||||
`(function ,name ,untypedArgs
|
`(function ,name ,untypedArgs
|
||||||
|
Reference in New Issue
Block a user