I’m stuck on Stage #RH7.
I’ve implemented the up arrow navigation feature by using the ReadLine nuget package. It works fine locally but it’s failing the tests.
Here are my logs:
[tester::#RH7] Running tests for Stage #RH7 (History - Up-arrow navigation)
[tester::#RH7] Running ./your_program.sh
[your-program] $ echo grape mango
[your-program] grape mango
[tester::#RH7] ✓ Command executed successfully
[your-program] $ echo banana mango
[your-program] banana mango
[tester::#RH7] ✓ Command executed successfully
[your-program] $ invalid_orange_command
[your-program] invalid_orange_command: not found
[tester::#RH7] ✓ Received command not found message
[your-program] $ echo grape apple
[your-program] grape apple
[tester::#RH7] ✓ Command executed successfully
[tester::#RH7] Pressed "<UP ARROW>" (expecting to recall "echo grape apple")
[tester::#RH7] ✓ Prompt line matches "echo grape apple"
[tester::#RH7] Pressed "<UP ARROW>" (expecting to recall "invalid_orange_command")
[your-program] $ echo grape apple
[tester::#RH7] ^ Line does not match expected value.
[tester::#RH7] Expected: "$ invalid_orange_command"
[tester::#RH7] Received: "$ echo grape apple"
[tester::#RH7] Assertion failed.
[tester::#RH7] Test failed (try setting 'debug: true' in your codecrafters.yml to see more details)
I’m using ReadLine to get the command:
string command = ReadLine.Read() ?? "";
and I’m adding every command to history afterward:
ReadLine.AddHistory(command);
Here it is running locally:
