diff --git a/cucumber b/cucumber index 8b574b6..63bd7f7 160000 --- a/cucumber +++ b/cucumber @@ -1 +1 @@ -Subproject commit 8b574b631d215e6d11bd00c91d496664b4f2e7aa +Subproject commit 63bd7f7cbd47d8f9825134a5a97414162b6a970f diff --git a/gherken.scm b/gherken.scm index b9f8a64..d65557a 100644 --- a/gherken.scm +++ b/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 ...))))) )) diff --git a/tests/run.scm b/tests/run.scm index db05c92..f21409d 100644 --- a/tests/run.scm +++ b/tests/run.scm @@ -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)))