File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -74,6 +74,8 @@ def test_code():
7474 * ``fallback``: a performer for this intent was provided by the fallback
7575 dispatcher
7676 * ``NOT FOUND``: no performer for this intent was found.
77+ * ``NEXT EXPECTED``: the next item in the sequence, if there is one. This
78+ will appear immediately after a ``NOT FOUND``.
7779
7880 :param list sequence: List of ``(intent, fn)`` tuples, where ``fn`` is a
7981 function that should accept an intent and return a result.
@@ -83,7 +85,12 @@ def test_code():
8385 used.
8486 """
8587 def fmt_log ():
86- return '{{{\n %s\n }}}' % ('\n ' .join (['%s: %s' % x for x in log ]),)
88+ next_item = ''
89+ if len (sequence .sequence ) > 0 :
90+ next_item = '\n NEXT EXPECTED: %s' % (sequence .sequence [0 ][0 ],)
91+ return '{{{\n %s%s\n }}}' % (
92+ '\n ' .join ('%s: %s' % x for x in log ),
93+ next_item )
8794
8895 def dispatcher (intent ):
8996 p = sequence (intent )
You can’t perform that action at this time.
0 commit comments