Commit Graph

8 Commits

Author SHA1 Message Date
Fabian Boehm
37f0d7c522 Work around more spurious test failures 2024-05-07 17:55:29 +02:00
Fabian Boehm
1d7fde7bf0 tests: Fix apple key "invalid escape sequence" with python 3.12 2024-05-07 17:55:29 +02:00
Fabian Boehm
0874dd6a96 pexpects: Fix spurious failure in generic.py
This used expect_re with a regex ending in `.*`, followed by an
`expect_prompt`.

This meant that, depending on the timing, the regex could swallow the
prompt marker, which caused extremely confusing output like

>Testing file pexpects/generic.py:Failed to match pattern: prompt 14
> ...
> OUTPUT      +1.33 ms (Line 70): \rprompt 13>functions\r\nN_, abbr,
> alias, bg, cd, [SNIP], up-or-search, vared, wait\r\n⏎
> \r⏎ \r\rprompt 14>

Yeah - it shows that "prompt 14" was in the output and it can't find
"prompt 14".

I could reproduce the failure locally when running the tests
repeatedly. I got one after 17 attempts and so far haven't been able
to reproduce it with this change applied.
2023-08-15 19:14:33 +02:00
Fabian Boehm
6489ef5ac0 Rewrite builtin functions in rust 2023-08-13 14:17:44 +02:00
Fabian Homborg
85ba2ed790 type: Add missing newline
Otherwise this would print

    # Defined interactivelyfunction foo

for interactively defined functions.
2021-01-03 17:48:25 +01:00
Fabian Homborg
cf8219e3ce Exit if --no-execute is enabled don't interactively read from the terminal
Don't go into implicit interactive mode without ever executing
anything - not even `exit` or reacting to ctrl-d. That just renders
the shell useless and unquittable.
2021-01-01 21:22:52 +01:00
Fabian Homborg
e6cdd315d1 tests/generic: Check for a literal match
I *think* this might sometimes (on CI) be eating the prompt, so that the actual `prompt`
part of `expect_prompt` doesn't find anything.

On Github Actions we see things like:

```
Testing file pexpects/generic.py ... Failed to match pattern: prompt 5
generic.py:35: timeout from expect_prompt("echo .history.*")

[...]

OUTPUT      +1.08 ms (Line 31): \rprompt 4>
 INPUT      +0.35 ms (Line 34): echo $history[1]\n
OUTPUT      +1.58 ms (Line 35): echo $history[1]\r\necho $history[1]\r\n⏎                                                                              \r⏎ \r\rprompt 5>
```

so the prompt *is* printed, it's just not correctly matched.
2020-11-13 15:20:37 +01:00
Fabian Homborg
f66edfdec2 Port generic.expect to pexpect
Removes a dumb workaround. Huzzah!
2020-06-08 22:57:46 +02:00