Macro
This commit is contained in:
parent
87efc1d204
commit
adb64cd49c
2
cucumber
2
cucumber
|
@ -1 +1 @@
|
|||
Subproject commit 8b574b631d215e6d11bd00c91d496664b4f2e7aa
|
||||
Subproject commit 63bd7f7cbd47d8f9825134a5a97414162b6a970f
|
24
gherken.scm
24
gherken.scm
|
@ -1,11 +1,27 @@
|
|||
(cond-expand
|
||||
(r7rs)
|
||||
(chicken (import (r7rs))))
|
||||
(import-for-syntax (r7rs))
|
||||
|
||||
(define-library (gherken)
|
||||
(import shell)
|
||||
(import json)
|
||||
(import utf8-srfi-152)
|
||||
(import (chicken port))
|
||||
(import r7rs
|
||||
utf8
|
||||
(chicken irregex)
|
||||
(chicken port)
|
||||
shell
|
||||
medea
|
||||
srfi-1
|
||||
srfi-69
|
||||
srfi-78
|
||||
srfi-123
|
||||
srfi-152
|
||||
srfi-197)
|
||||
(export given)
|
||||
(begin
|
||||
(define lang-registry (make-hash-table))
|
||||
|
||||
(define-syntax given
|
||||
(syntax-rules ()
|
||||
((given picklex args ...)
|
||||
(hash-table-set! lang-registry picklex (lambda args ...)))))
|
||||
))
|
||||
|
|
|
@ -4,14 +4,17 @@
|
|||
srfi-69
|
||||
srfi-78
|
||||
shell
|
||||
json-abnf
|
||||
medea
|
||||
srfi-123
|
||||
srfi-152
|
||||
srfi-197
|
||||
(chicken port))
|
||||
|
||||
(define output (capture ("./gherkinexe" "--no-ast" "--no-source" "cucumber/gherkin/c/testdata/good/rule.feature")))
|
||||
(define outputs (string-split (string-trim-both output) "\n"))
|
||||
(define json-string (string-concatenate (list "[" (string-join outputs ", ") "]")))
|
||||
(define pickle #f)
|
||||
(let* ((pickles (parser json-string))
|
||||
(pickle (cdar (vector-ref pickles 0))))
|
||||
(set! pickle pickle))
|
||||
(define pickle
|
||||
(chain (capture ("./gherkinexe" "--no-ast" "--no-source" "cucumber/gherkin/c/testdata/good/tags.feature"))
|
||||
(string-trim-both _)
|
||||
(string-split _ "\n")
|
||||
(string-join _ ", ")
|
||||
(list "[" _ "]")
|
||||
(string-concatenate _)
|
||||
(with-input-from-string _ read-json)))
|
||||
|
|
Loading…
Reference in New Issue