Closed yedayak closed 2 months ago
I think this should be tested within test/t/test_scp.py
. The test/t/unit/test_unit_*.py
are the tests for the core components in bash_completion
. Except for that, LGTM.
I think this should be tested within
test/t/test_scp.py
. Thetest/t/unit/test_unit_*.py
are the tests for the core components inbash_completion
. Except for that, LGTM.
Moved to test/t/test_scp.py
.
I had to add @pytest.mark.bashcomp(ignore_env=r"^\+COMPREPLY=")
to the entire class, I'm not sure if there is a better way to only apply it to the necessary functions.
I'm not sure if there is a better way to only apply it to the necessary functions.
You can call bash_env.save_variable("COMPREPLY")
.
I'm not sure if there is a better way to only apply it to the necessary functions.
You can call
bash_env.save_variable("COMPREPLY")
.
This doesn't seem to work, the diff doesn't look at the saved variables, it just uses get_env()
which is basically just _comp__test_get_env
.
I'm not sure if there is a better way to only apply it to the necessary functions.
You can call
bash_env.save_variable("COMPREPLY")
.This doesn't seem to work,
How have you checked that it doesn't seem to work? I now tried that, but it works.
the diff doesn't look at the saved variables, it just uses
get_env()
which is basically just_comp__test_get_env
.
The saved variables are restored by bash_env
. get_env()
is called after the with
statement calls bash_env_saved.__exit__()
and the saved variables are restored.
I'm not sure if there is a better way to only apply it to the necessary functions.
You can call
bash_env.save_variable("COMPREPLY")
.This doesn't seem to work,
How have you checked that it doesn't seem to work? I now tried that, but it works.
the diff doesn't look at the saved variables, it just uses
get_env()
which is basically just_comp__test_get_env
.The saved variables are restored by
bash_env
.get_env()
is called after thewith
statement callsbash_env_saved.__exit__()
and the saved variables are restored.
Ah I managed it, I was trying to save the variable after it was changed, which in hindsight obviously doesn't make sense :)
Since there doesn't seem to be any unit tests for xfuncs, I'm not sure if the naming here makes sense, or if I should make some more directories, for example a
unit/xfunc
orfixtures/xfunc
?I did this since there seems to be a lot of issues with this function, as seen in https://github.com/scop/bash-completion/pull/910 and https://github.com/scop/bash-completion/pull/765#issuecomment-1173097965 This should be a first good step to make fixing the issues easier IMO.