summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2019-06-23 10:23:09 +0300
committerLars Wirzenius <liw@liw.fi>2019-06-23 10:23:09 +0300
commitf51aa48e22d366e04bc64b9af60727f257c3ef99 (patch)
tree99e8b0bf15e33de565d9db93fe29c5eca660ffca
parent2496b32fda6f6adddab14c93dded4ce657ca94e4 (diff)
downloadfable-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-xftt-docgen7
1 files changed, 6 insertions, 1 deletions
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: