I’m stuck on Stage #IP1
It always gives me following error:
[tester::#IP1] Expected: “Arg #0 (program name): custom_exe_1165”
[tester::#IP1] Received: “Arg #0 (program name): /tmp/dog/custom_exe_1165”
This seems to not be caused by the code itself but somehow how the tests run on the remote server. Any ideas how to fix this?
Hey @Bekobii, looks like you’ve got past this stage. Do you happen to remember what was wrong? Would love to see if we can improve the tester / instructions.
Hey,
Yeah I got it working… I had to use the raw input of the command for the process creation without looking it up in directories of the PATH variable. That seems quite weird to me considering I just had to implement the function to look up programs in PATH for this stage.
_ => match find_executable_program(command) {
Some(program_path) => {
execute_program(&command, &tokens[1..]);
}
None => println!(“{}: not found”, command),
},
fn execute_program(program: &str, args: &[&str]) {
Command::new(program)
.args(args)
.stdout(Stdio::inherit())
.output()
.expect(“Failed to execute command”);
}
No Idea how to get code formatting on the editor here…
As you can see I had to directly pass the command to the process creation instead of resolving it via the PATH variable. That unfortunately broke the shell on my local system because I was not able to resolve programs anymore.
Yeah, I agree it’s a bit weird, but the test is verifying that your shell matches Bash’s behavior on Linux. For example:
Alright, maybe it would be good to add this as a info to the task? To first lookup programs in the current directory and then resolving the PATH variable if nothing is found?
At least that is what I am assuming is expected from the tester.
Edit: Nevermind I just saw that it just mentions to look up if the executable is in the PATH and not to use the PATH. I think I was confused because the task before told me to report the full path ^^
Nevermind then