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
|
(cond-expand
|
||||||
(r7rs)
|
(r7rs)
|
||||||
(chicken (import (r7rs))))
|
(chicken (import (r7rs))))
|
||||||
|
(import-for-syntax (r7rs))
|
||||||
|
|
||||||
(define-library (gherken)
|
(define-library (gherken)
|
||||||
(import shell)
|
(import r7rs
|
||||||
(import json)
|
utf8
|
||||||
(import utf8-srfi-152)
|
(chicken irregex)
|
||||||
(import (chicken port))
|
(chicken port)
|
||||||
|
shell
|
||||||
|
medea
|
||||||
|
srfi-1
|
||||||
|
srfi-69
|
||||||
|
srfi-78
|
||||||
|
srfi-123
|
||||||
|
srfi-152
|
||||||
|
srfi-197)
|
||||||
|
(export given)
|
||||||
(begin
|
(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-69
|
||||||
srfi-78
|
srfi-78
|
||||||
shell
|
shell
|
||||||
json-abnf
|
medea
|
||||||
|
srfi-123
|
||||||
srfi-152
|
srfi-152
|
||||||
|
srfi-197
|
||||||
(chicken port))
|
(chicken port))
|
||||||
|
|
||||||
(define output (capture ("./gherkinexe" "--no-ast" "--no-source" "cucumber/gherkin/c/testdata/good/rule.feature")))
|
(define pickle
|
||||||
(define outputs (string-split (string-trim-both output) "\n"))
|
(chain (capture ("./gherkinexe" "--no-ast" "--no-source" "cucumber/gherkin/c/testdata/good/tags.feature"))
|
||||||
(define json-string (string-concatenate (list "[" (string-join outputs ", ") "]")))
|
(string-trim-both _)
|
||||||
(define pickle #f)
|
(string-split _ "\n")
|
||||||
(let* ((pickles (parser json-string))
|
(string-join _ ", ")
|
||||||
(pickle (cdar (vector-ref pickles 0))))
|
(list "[" _ "]")
|
||||||
(set! pickle pickle))
|
(string-concatenate _)
|
||||||
|
(with-input-from-string _ read-json)))
|
||||||
|
|
Loading…
Reference in New Issue