Remote tests results doesn't match with my local results

I’m stuck on Stage #EZ5.

I’m a little bit confuse with tests results. When I run the code in my machine (Linux Ubuntu), my implementation return the following result:

$ type echo
echo is /usr/bin/echo
$ type invalid_command
invalid_command: not found
$ type ls
ls is /usr/bin/ls
$ type echo
echo is /usr/bin/echo
$

In this case, my tests were with command echo first, second test invalid_command, third test with ls command e finally with echo command again. After this tests, as we can see, the results appear consistent with the requirements.

However, when I push the code to the repository, the tests return:

remote: [tester::#EZ5] Running tests for Stage #EZ5 (The type builtin: builtins)
remote: [tester::#EZ5] Running ./your_program.sh
remote: [your-program] $ type echo
remote: [your-program] echo is /bin/echo
remote: [tester::#EZ5] Output does not match expected value.
remote: [tester::#EZ5] Expected: “echo is a shell builtin”
remote: [tester::#EZ5] Received: “echo is /bin/echo”
remote: [your-program] $

I didn’t understood the return Expected: “echo is a shell builtin”, I haven’t this output in my code, only in the previous version when I implemented the first version.

Hi @alexncosta, the output from your code is correct to a certain extent:

Actually, echo is both a built-in command and an executable on most systems.

You can verify this fact in a real shell. Here’s an example from zsh on my machine:

To resolve the issue, ensure that built-in commands take precedence in your code.


I didn’t understood the return Expected: “echo is a shell builtin”, I haven’t this output in my code, only in the previous version when I implemented the first version.

It’s not uncommon for changes introduced later to inadvertently affect earlier stages.

You can use our CLI to test against previous stages by running:

codecrafters test --previous