# Incorrect tester message for shell #PN5

**URL:** <https://forum.codecrafters.io/t/incorrect-tester-message-for-shell-pn5/7603>\
**Category:** Bug Reports\
**Tags:** challenge:shell\
**Created:** [March 26, 2025, 1:37am UTC](https://forum.codecrafters.io/t/incorrect-tester-message-for-shell-pn5/7603 "2025-03-26T01:37:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [March 26, 2025, 1:37am UTC](https://forum.codecrafters.io/t/incorrect-tester-message-for-shell-pn5/7603/1 "2025-03-26T01:37:33Z")

</div>

On stage #PN5, if a program is implemented so that it says `exit: command not found` when an exit command is issued, the tester logs say this:

```auto
[tester::#PN5] Running tests for Stage #PN5 (The exit builtin)
[tester::#PN5] Running ./your_program.sh
[your-program] $ invalid_orange_command
[your-program] invalid_orange_command: command not found
[tester::#PN5] ✓ Received command not found message
[your-program] $ exit 0
[tester::#PN5] Error reading output: condition not met
[tester::#PN5] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)

```

Screenshot w/ colored logs:

 ![Screenshot 2025-03-25 at 18.33.02](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/1/1de945a1aa2ab675cb90264d9efc41b035597d7a.png)

Here’s what I get when running my program locally and executing the same command:

 ![Screenshot 2025-03-25 at 18.35.13](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/6/6b726a39619896ca9b97c3eba9e1b75c20828890.png)

Here’s a snippet of my code:

```rust
use std::io::{self, Write};

fn main() {
    loop {
        print!("$ ");
        io::stdout().flush().unwrap();

        let mut input = String::new();
        io::stdin().read_line(&mut input).unwrap();
        input = input.trim().to_string();

        let command_with_args = input.split_whitespace().collect::<Vec<&str>>();
        let command = command_with_args[0];
        let args = command_with_args[1..].to_vec();

        if input == "exit" {
            break;
        }

        println!("{}: command not found", command);
    }
}

```

The fix is simple (change `input == "exit"` to `command == "exit"`), but the tester message is pretty confusing. Instead of “condition not met”, I’d expect:

- (a) a message indicating that the program was expected to exit but it didn’t.
- (b) the rest of my program’s output, i.e. the second prompt to be printed so that I know what it did wrong

---

<div class="post-metadata">

**Author:** ![nitishbhosale7](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/nitishbhosale7/32/10035_2.png) [@nitishbhosale7](https://forum.codecrafters.io/u/nitishbhosale7)\
**Post date:** [April 28, 2025, 12:37pm UTC](https://forum.codecrafters.io/t/incorrect-tester-message-for-shell-pn5/7603/4 "2025-04-28T12:37:40Z")

</div>

@rohitpaulk  
Replace the line \< if input == “exit” \> with \< if input == “exit 0”

It will work

---

<div class="post-metadata">

**Author:** ![andy1li](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/andy1li/32/10_2.png) [@andy1li](https://forum.codecrafters.io/u/andy1li)\
**Post date:** [July 16, 2025, 1:38am UTC](https://forum.codecrafters.io/t/incorrect-tester-message-for-shell-pn5/7603/5 "2025-07-16T01:38:44Z")

</div>

Resolved by @Arpan-206 : [The error messages should be more descriptive now by Arpan-206 · Pull Request #120 · codecrafters-io/shell-tester · GitHub](https://github.com/codecrafters-io/shell-tester/pull/120)

---

<div class="post-metadata">

**Author:** ![rohitpaulk](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/rohitpaulk/32/6_2.png) [@rohitpaulk](https://forum.codecrafters.io/u/rohitpaulk)\
**Post date:** [July 23, 2025, 1:39am UTC](https://forum.codecrafters.io/t/incorrect-tester-message-for-shell-pn5/7603/6 "2025-07-23T01:39:11Z")

</div>

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