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