I saw that recently this was fix with this bug report
Hi! I’ve added the code to ring the bell on failed autocompletion. It seems to be working fine on my macOS, but unfortunately tester does not recognize the ‘\007’ bell control symbol. Anyone else had similar problem?
[image]
It looks like it failing for me
This is my go code
case c == '\t':
start := time.Now()
partialInput := string(bytes.TrimSpace(inputBuffer))
cmds := cmdContainer.CmdTrie.GetCmds(partialInput)
if len(cmds) > 0 {
autoCompleted := fmt.Sprintf("%s ", cmds[0][1:])
if autoCompleted != " " {
fmt.Fprintf(os.Stdin, autoCompleted)
inputBuffer = append(inputBuffer, []byte(autoCompleted)...)
} else {
// time.Sleep(1 * time.Millisecond)
fmt.Fprintf(os.Stdout, "%c", '\x07')
end := time.Now()
fmt.Fprint(os.Stdout, "\r\nBell took nanos: ", end.Sub(start).Nanoseconds())
}
}
and this is the output
/your_program.sh
$ xyz
Bell took nanos: 48237
mine takes less than a millisecond, in the thread above it looks like the test was timing out at 50ms
any help is appreciated
this is my repo link : https://git.codecrafters.io/40b24cd4c4446918
thanks
Hi @wildchild04 , thanks for highlighting the issue! We’ll look into it and keep you updated.
1 Like
I cloned the shell-tester and I ran the test locally
it looks like its working
I ran it using CODECRAFTERS_TEST_CASES_JSON as
[
{
"slug": "qm8",
"tester_log_prefix": "test",
"title": "test"
}
]
I wonder if it is something extra for xyz in the test box PATH, I dont have xyz
installed, as work around I just placed an empy file in my ~/.local/bin with that name and executable
After changing my implementation to deal with the next step, it looks like the test passed on the remote tester. Computers are silly and funny
I’ll close this topic when I figure it out how to
thanks
1 Like
system
Closed
February 16, 2025, 9:28pm
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.