From f51aa48e22d366e04bc64b9af60727f257c3ef99 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 23 Jun 2019 10:23:09 +0300 Subject: Fix: matching steps to bindings The keyword-less step had a leading whitespace, which meant no binding matched. We drop leading whitepspace now. --- ftt-docgen | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ftt-docgen b/ftt-docgen index 93a6fb3..f1f23a7 100755 --- a/ftt-docgen +++ b/ftt-docgen @@ -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: -- cgit v1.2.1