#GP4 tester error

Hello,

I’m having issue passing #GP4 but not sure why.

If I do codecrafter test , it goes well with this output:

[tester::#GP4] Running tests for Stage #GP4 (Navigation - The cd builtin: Home directory)
[tester::#GP4] Running ./your_program.sh
[your-program] $ cd /tmp/grape/strawberry/strawberry
[your-program] $ pwd
[your-program] /tmp/grape/strawberry/strawberry
[tester::#GP4] Received current working directory response
[your-program] $ cd ~
[your-program] $ pwd
[your-program] /tmp/apple/pear/apple
[tester::#GP4] Received current working directory response
[your-program] $
[tester::#GP4] Test passed.

Then, I do codecrafter submit, and it throws a weird result:

[tester::#GP4] Running tests for Stage #GP4 (Navigation - The cd builtin: Home directory)
[tester::#GP4] Running ./your_program.sh
[your-program] $ cd /tmp/mango/grape/grape
[your-program] $ pwd
[your-program] /tmp/mango/grape/grape
[tester::#GP4] Received current working directory response
[your-program] $ cd ~
[your-program] $ pwd
[your-program] malloc(): invalid size (unsorted)
[tester::#GP4] Output does not match expected value.
[tester::#GP4] Expected: "/tmp/raspberry/pear/pineapple"
[tester::#GP4] Received: "malloc(): invalid size (unsorted)"
[tester::#GP4] Assertion failed.
[tester::#GP4] Test failed

I’m doing something wrong, or the tester has a bug?

Thanks,

Hey @amarjen, it was likely a tester bug that allowed the code to pass the first time.

Passing ~ directly into chdir will not work as expected:

You’ll need to expand ~ to the full path for chdir to work properly.

Let me know if you’d like further clarification!

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.