diff options
author | Lars Wirzenius <liw@liw.fi> | 2019-06-23 10:23:09 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2019-06-23 10:23:09 +0300 |
commit | f51aa48e22d366e04bc64b9af60727f257c3ef99 (patch) | |
tree | 99e8b0bf15e33de565d9db93fe29c5eca660ffca | |
parent | 2496b32fda6f6adddab14c93dded4ce657ca94e4 (diff) | |
download | fable-poc-f51aa48e22d366e04bc64b9af60727f257c3ef99.tar.gz |
Fix: matching steps to bindings
The keyword-less step had a leading whitespace, which meant no binding
matched. We drop leading whitepspace now.
-rwxr-xr-x | ftt-docgen | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -52,14 +52,19 @@ def format_scenario_step(bind, line, prev_keyword): sys.exit('AND may not be used on first step in snippet') real_keyword = prev_keyword debug('keyword: %r' % keyword) - line = line[len(keyword):] + line = line[len(keyword):].lstrip() debug('line: %r' % line) for b in bind: + debug('consider binding %r' % b) if real_keyword not in b: + debug('keyword %r not in binding' % real_keyword) continue m = re.match(b[real_keyword.lower()], line, re.I | re.M) + debug('m: %r' % m) if m and m.end() == len(line): + debug('match: %r' % line) + debug(' : %r' % m.groupdict()) line = format_match(keyword, line, m) break else: |