-
-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add tests for all bash prompt special characters #2236
add tests for all bash prompt special characters #2236
Conversation
spec/prompt.test.sh
Outdated
|
||
#### \l for TTY device basename | ||
PS1='foo \l bar' | ||
tty_device_basename="$(basename "$(tty)")" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it ok to rely on external programs basename
and tty
?
Thanks, this looks very helpful! I let the CI run, but the spec tests timed out after 15 minutes. Then I cloned locally and noticed that test case 27 for If I do
then it hangs Though I am not sure why, because when I run it manually it doesn't hang
|
Here is the CI dashboard https://mb.oilshell.org/uuu/github-jobs/9010/ and then if you click through you can see a timeout after 15 minutes, which is the max we let it run: https://mb.oilshell.org/uuu/github-jobs/9010/#job-ovm-tarball The tests aren't really sandboxed, so we basically use a Docker container I build as a source of truth ... (could be improved at some point) To make progress, I might just comment out test case 27 for now, and then we can see if the others pass? If there are a bunch of green tests for bash, and a red ones for OSH, and it runs reliably in the CI, then that is good progress, and can be merged I tend to break things up in steps, so we can do |
BTW the way I "extract" the test case is And I either run with How many of the tests pass locally on bash, on your machine? I am seeing a few failures other than the |
$ sleep 999 &
[%1] PID 12220 Started
$ echo %%
%%
$ kill %%
kill: ‘%%’: invalid process id
$ fg
fg: PID 12220 Continued
^C
$
|
I'm struggling to come up with a good way to run the "command number" prompt test. I have to either find a reliable way to get the current "command number", which I'm not sure is even implemented in |
on my machine, all the prompt test cases pass for bash except 0 and 32. |
OK looks like 9 tests fail on OSH, and they pass on bash: https://mb.oilshell.org/uuu/github-jobs/9023/ovm-tarball.wwz/_tmp/spec/osh-py/prompt.html Thanks! I pushed a change to add this metadata line, which lets the CI pass
and then we can "whittle down" the errors as we go |
I also added you as a collaborator, so you can run the CI yourself, and don't have to wait for me to hit "approve" Most contributors directly modify a branch of It is a weird github limitation - https://github.com/oils-for-unix/oils/wiki/Contributing |
OK let me see what hapepns if I try to merge ... the CI checks didn't finish because of the permission issue, but maybe it will go through on |
(The merged worked! But from now on, please work in the upstream repo, so then you can see the CI results immediately without waiting for approval ) Thanks for the tests! I was able to knock off And it worked in C++ transparently Let me look at some others |
I think I mean I can understand why we should have them, but it annoys me to carry that over, since it is more readable to use rather than remembering what those mean |
I am not quite sure how to get history number or command number, and what the exact difference is I think the history number should come from GNU readline -- if we already have an API, then it shouldn't be too hard to add |
#2235