Skip to content

feat(steps): quotes around typed step parameters are optional, decided by the type - #166

Merged
bddkit merged 1 commit into
bddkit:mainfrom
sergeym:feat/issue-79-optional-quotes
Oct 28, 2026
Merged

bddkit merged 1 commit into
bddkit:mainfrom
sergeym:feat/issue-79-optional-quotes

Conversation

@sergeym

@sergeym sergeym commented Oct 28, 2026

Copy link
Copy Markdown
Collaborator

Closes #79.

A bare {x} takes its quotes from the parameter's type: uint, int, float, word, method accept 5 and "5"; text/secret require "…"; any is as written. Quotes written in a declaration stay literal. I sleep and the two within … steps drop their quotes; the quoted forms still match.

Breaking for macro templates:

  • an untyped quoted {x} before a bare typed parameter can overlap a builtin ending in a quoted any and is refused at startup — write {x:text};
  • a bare {x:text}/{x:secret} now requires quotes;
  • word no longer matches ".

Typed parameters use a compact <<…>> slot shape in the step regex (the exact PLACEHOLDER cost ~0.5 s per use in debug via the expressions crate); a typed argument that is not a whole slot makes the step match nothing, so it is still refused before the first request.

…d by the type (bddkit#79)

A bare {x} in a step declaration takes its quotes from the parameter's type:
uint, int, float, word and method accept 5 and "5"; text and secret require
"..."; any is as written. Quotes written into a declaration stay literal, and
a parameter is bare only when an even number of double quotes precede it. I
sleep and both 'I expect the next assertion to pass within' steps drop their
literal quotes; the quoted forms still match.

Typed parameters use a compact <<...>> slot shape in the step regex, because
the exact vars::PLACEHOLDER costs about 0.5 s per use in a debug build once
the expressions crate expands it. A typed argument that starts with << but is
not a whole slot makes the step match nothing, so validate::check still
refuses it before the first request. word no longer matches a double quote,
and the numeric types use ASCII digits.

BREAKING CHANGE: a macro template with an untyped quoted {x} before a bare
typed parameter can overlap a builtin ending in a quoted any parameter and is
refused at startup (write {x:text}); a bare {x:text} or {x:secret} in a macro
template now requires quotes; word no longer matches a double quote.
@sergeym
sergeym force-pushed the feat/issue-79-optional-quotes branch from 165bf83 to e1efa0f Compare October 28, 2026 21:23
@bddkit
bddkit merged commit 624bb96 into bddkit:main Oct 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Quotes around typed step parameters: optional, decided by the parameter's type

2 participants