Shell autocompletion succeed locally, but not with codecrafters tests

I’m stuck on Stage #QP2 (Built-in command completion).

It works locally, but not when I use the CodeCrafters test tool (and neither on the website after a git push).

Here the logs:

[tester::#QP2] Pressed "<TAB>" (expecting autocomplete to "echo")
[your-program] $ ech
[tester::#QP2] Output does not match expected value.
[tester::#QP2] Expected: "$ echo "
[tester::#QP2] Received: "$ ech"

My code can be found here: GitHub - MstchCmBck/gosh: A shell written in Go

I use a librairy for the first time to implement autocompletion (“GitHub - chzyer/readline: Readline is a pure go(golang) implementation for GNU-Readline kind library”). According to your documentation, it’s allowed. But it requires to modify the go.mod file, which has a comment on the top stipulating that it shouldn’t be modified.

Hey @MstchCmBck, we’ll look into the issue and keep you updated once we have a fix.

@MstchCmBck We’ve pushed a fix for chzyer/readline in this PR. Let us know if it works for you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.