mirror of
https://github.com/janet-lang/janet
synced 2024-09-06 04:26:50 +00:00
50 lines
603 B
Plaintext
50 lines
603 B
Plaintext
|
|
(os/mkdir "./tools/afl/unmarshal_testcases/")
|
|
|
|
(defn spit-case [n v]
|
|
(spit
|
|
(string "./tools/afl/unmarshal_testcases/" (string n))
|
|
(marshal v make-image-dict)))
|
|
|
|
(def cases [
|
|
nil
|
|
|
|
"abc"
|
|
|
|
:def
|
|
|
|
'hij
|
|
|
|
123
|
|
|
|
(int/s64 123)
|
|
|
|
"7"
|
|
|
|
[1 2 3]
|
|
|
|
@[1 2 3]
|
|
|
|
{:a 123}
|
|
|
|
@{:b 'xyz}
|
|
|
|
(peg/compile
|
|
'{:a (* "a" :b "a")
|
|
:b (* "b" (+ :a 0) "b")
|
|
:main (* "(" :b ")")})
|
|
|
|
(fn f [a] (fn [] {:ab a}))
|
|
|
|
(fn f [a] (print "hello world!"))
|
|
|
|
(do
|
|
(defn f [a] (yield) @[1 "2"])
|
|
(def fb (fiber/new f))
|
|
(resume fb)
|
|
fb)
|
|
])
|
|
|
|
(eachk i cases
|
|
(spit-case i (in cases i)))
|