Skip to content
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

Test repl completions #10784

Closed
Ericson2314 opened this issue May 27, 2024 · 4 comments · Fixed by #10799
Closed

Test repl completions #10784

Ericson2314 opened this issue May 27, 2024 · 4 comments · Fixed by #10799
Labels
feature Feature request or proposal repl The Read Eval Print Loop, "nix repl" command and debugger tests

Comments

@Ericson2314
Copy link
Member

#10778 reminded me that we don't test repl completions (which can be different from CLI completions, yay).

Doing so is not easy, because readline calls the completions callback, and doesn't want to do so when standard input is not a pseudo terminal. We'll have to either force readline to do it anyways (during testing), or create a pseudo terminal as part of the test.

@Ericson2314 Ericson2314 added feature Feature request or proposal tests labels May 27, 2024
@Mic92
Copy link
Member

Mic92 commented May 27, 2024

Some expect like test? What languages for testing do we have at our disposal?

@Ericson2314
Copy link
Member Author

Right now the "functional" tests are written in bash, and I guess making some pseudo terminals in bash is a bit of a pain per https://unix.stackexchange.com/questions/179030/how-do-i-come-by-this-pty-and-what-can-i-do-with-it

@Mic92
Copy link
Member

Mic92 commented May 27, 2024

If we don't want to bloat the dev dependencies by adding TCL or python, using tmux scripting API might be an option.

@roberth
Copy link
Member

roberth commented May 28, 2024

I've written a separate check with expect; see #10799

If we don't want to bloat the dev dependencies by adding TCL or python, using tmux scripting API might be an option.

I wrote it before this issue was opened, but didn't manage to make a PR yet.
I don't think it's too bad as long as it's not in the "critical" dependencies, such as the dev shell, let alone package dependencies.

@roberth roberth added the repl The Read Eval Print Loop, "nix repl" command and debugger label May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature request or proposal repl The Read Eval Print Loop, "nix repl" command and debugger tests
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants