Test Passing Locally but not in Remote

The remote test keeps failing for task #WH-6 of the autocompletion challenge.

I’ve verified that the TAB completion works locally but the test keeps failing for some reason

This is the test output:

remote: [tester::#GM9] Running tests for Stage #GM9 (Autocompletion - Completion with arguments)
remote: [tester::#GM9] Running ./your_program.sh
remote: [tester::#GM9] ✓ Received prompt ($ )
remote: [tester::#GM9] Typed "ech"
remote: [tester::#GM9] ✓ Prompt line matches "$ ech"
remote: [tester::#GM9] Pressed "<TAB>" (expecting autocomplete to "echo")
remote: [your-program] $ ech
remote: [tester::#GM9] Output does not match expected value.
remote: [tester::#GM9] Expected: "$ echo "
remote: [tester::#GM9] Received: "$ ech"
remote: [tester::#GM9] Assertion failed.
remote: [tester::#GM9] Test failed

My code can be found in the repo here GitHub - Kushagra1480/w-shell

Hey @Kushagra1480, could you upload your code to GitHub and share the link? It will be much easier to debug if I can run it directly.

Can confirm that the linked code does not work locally as of now. On typing “ech” and then clicking Tab once, no autocompletion is registered. On clicking Tab twice, I get back multiple completions:

The reason is you are concatenating both the built-in commands and the executables found in the PATH as a slice to get all possible completions. This breaks things, as echo is both an executable in the tester’s PATH, as well as a built-in command we have implemented in the previous stages. Deduplicating the commands should fix the same.

1 Like

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

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