# Test Case failing for #IP1

**URL:** <https://forum.codecrafters.io/t/test-case-failing-for-ip1/3351>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [December 8, 2024, 6:31am UTC](https://forum.codecrafters.io/t/test-case-failing-for-ip1/3351 "2024-12-08T06:31:33Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bijancfarahani](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/bijancfarahani/32/3367_2.png) [@bijancfarahani](https://forum.codecrafters.io/u/bijancfarahani)\
**Post date:** [December 8, 2024, 6:31am UTC](https://forum.codecrafters.io/t/test-case-failing-for-ip1/3351/1 "2024-12-08T06:31:33Z")

</div>

I’m stuck on Stage #(IP1).

The test checks the output before my program has finished printing it all.

Here are my logs:  
remote: [tester::#IP1] Running tests for Stage #IP1 (Run a program)  
remote: [tester::#IP1] Running ./your\_program.sh  
remote: [your-program] $  
remote: [tester::#IP1] \> my\_exe Emily  
remote: [your-program] Hello Emily  
remote: [tester::#IP1] Expected: “Hello Emily! The secret code is 7427569622.”  
remote: [tester::#IP1] Received: “Hello Emily”  
remote: [your-program] ! The secret code is 7427569622.  
remote: [your-program] $  
remote: [tester::#IP1] Received output does not match expectation.

And here’s a snippet of my code:

```rust
fn execute_external_command(command: &str, arguments: &str) {
    if let Some(path) = find_command(command) {
        Command::new(path)
            .arg(arguments)
            .status()
            .expect("Failed to execute command");
    } else {
        println!("{}: command not found", command);
    }
}

```

---

<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:** [December 8, 2024, 10:51am UTC](https://forum.codecrafters.io/t/test-case-failing-for-ip1/3351/3 "2024-12-08T10:51:57Z")

</div>

Hi @bijancfarahani, could you [upload your code to GitHub](https://docs.codecrafters.io/features/publish-to-github) and share the link? It will be much easier to debug if I can run it directly.

---

<div class="post-metadata">

**Author:** ![bijancfarahani](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/bijancfarahani/32/3367_2.png) [@bijancfarahani](https://forum.codecrafters.io/u/bijancfarahani)\
**Post date:** [December 9, 2024, 1:40am UTC](https://forum.codecrafters.io/t/test-case-failing-for-ip1/3351/5 "2024-12-09T01:40:55Z")

</div>

> **[GitHub - bijancfarahani/codecrafters-shell-rust](https://github.com/bijancfarahani/codecrafters-shell-rust)**
>
> Contribute to bijancfarahani/codecrafters-shell-rust development by creating an account on GitHub.

thanks for the help

---

<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:** [December 9, 2024, 6:00am UTC](https://forum.codecrafters.io/t/test-case-failing-for-ip1/3351/7 "2024-12-09T06:00:29Z")

</div>

Thanks for sharing the link! I’ll take a look and get back to you by the end of the week.

---

<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:** [December 15, 2024, 2:30pm UTC](https://forum.codecrafters.io/t/test-case-failing-for-ip1/3351/8 "2024-12-15T14:30:01Z")

</div>

I tried running your code against the previous stages, but it’s actually no longer passing the stage **#IZ3 (The echo builtin)**.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/2X/d/dee3ebaf3a7e2cc74384fd1caff7a2757bdc3b82.png)

Suggestions:

1. Use [our CLI](https://docs.codecrafters.io/cli/installation) to test against previous stages by running:

```auto
codecrafters test --previous

```

1. Focus on fixing the early stages first, as later stages depend on them.

---

<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:** [December 21, 2024, 8:13pm UTC](https://forum.codecrafters.io/t/test-case-failing-for-ip1/3351/10 "2024-12-21T20:13:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/0/700657133935c15703e22c7c8870394f6e6dc27d.svg) [@system](https://forum.codecrafters.io/u/system)\
**Post date:** [December 26, 2024, 8:14pm UTC](https://forum.codecrafters.io/t/test-case-failing-for-ip1/3351/11 "2024-12-26T20:14:04Z")

</div>

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