[PATCH 5 of 9] run-tests: document the `pos` variable in the matching code

Joerg Sonnenberger joerg at bec.de
Sat Sep 7 08:59:11 EDT 2019


On Sat, Sep 07, 2019 at 02:16:44PM +0200, Pierre-Yves David wrote:
> diff --git a/tests/run-tests.py b/tests/run-tests.py
> --- a/tests/run-tests.py
> +++ b/tests/run-tests.py
> @@ -1609,6 +1609,9 @@ class TTest(Test):
>          if exitcode != 0:
>              warnonly = WARN_NO
>  
> +        # `pos` is the key for the currently expected output it should match an
> +        # entry in `expected`. This `pos` is provided by "command" in the
> +        # output stream. These command are recognised using the `salt`

That should be *on* entry.

>          pos = -1
>          postout = []
>          for out_rawline in output:
> @@ -1628,6 +1631,7 @@ class TTest(Test):
>                  optional = []
>                  for i, el in enumerate(els):
>                      r = False
> +                    assert el is None or bool(el)
>                      if el:
>                          r, exact = self.linematch(el, out_line)
>                      if isinstance(r, str):

Is this chunk intentional?

Joerg


More information about the Mercurial-devel mailing list