# Multiple completions #WH6 - failing test case

**URL:** <https://forum.codecrafters.io/t/multiple-completions-wh6-failing-test-case/15813>\
**Category:** Challenges\
**Tags:** challenge:shell\
**Created:** [January 21, 2026, 2:48pm UTC](https://forum.codecrafters.io/t/multiple-completions-wh6-failing-test-case/15813 "2026-01-21T14:48:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![goose-729](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/goose-729/32/32_2.png) [@goose-729](https://forum.codecrafters.io/u/goose-729)\
**Post date:** [January 21, 2026, 2:48pm UTC](https://forum.codecrafters.io/t/multiple-completions-wh6-failing-test-case/15813/1 "2026-01-21T14:48:37Z")

</div>

I’m stuck on Stage Multiple completions #WH6.

As suggested in Builtin completion #QP2 I am using the **[readline](https://en.wikipedia.org/wiki/GNU_Readline)** NuGet package. And I am having trouble with one of the test ("$ custom ”. Autocomplete with 1 found match).

The main issue is I am struggling to replicate it on my local:

![Screen Recording 2026-01-21 at 15.38.35.mov video-to-gif output image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/8/b/8bacc4bd10e904f1faf585ae7b1e00f88a1fc5b0.gif)

This is my code:

```csharp
    public string[] GetSuggestions(string text, int index)
    {
        if (string.IsNullOrWhiteSpace(text))
            return null!;

        var matches = _commands
            .Concat(FileExecuter.FindExecutablesAtPath())
            .Where(c => c.StartsWith(text, StringComparison.OrdinalIgnoreCase))
            .Distinct()
            .OrderBy(c => c)
            .ToList();

        if (matches.Count == 0)
        {
            _tabCount = 0;
            Console.Write("\x07");
            return null!;
        }

        if (matches.Count == 1)
        {
            _tabCount = 0;
            return [$"{matches[0]} "];
        }

        ...

```

The failing test:

```bash
[tester::#GY5] ✓ Received prompt ($ )
[tester::#GY5] Typed "custom"
[tester::#GY5] ✓ Prompt line matches "$ custom"
[tester::#GY5] Pressed "<TAB>" (expecting autocomplete to "custom_exe_5432")
[your-program] $ custom
[tester::#GY5] ^ Line does not match expected value.
[tester::#GY5] Expected: "$ custom_exe_5432 "
[tester::#GY5] Received: "$ custom"
[tester::#GY5] Assertion failed.
[tester::#GY5] Test failed

```

But if I update my code:

```csharp
        if (matches.Count == 1)
        {
            Console.WriteLine(matches[0]); // <- new line added
            _tabCount = 0;
            return [$"{matches[0]} "];
        }

```

```bash
[tester::#GY5] ✓ Received prompt ($ )
[tester::#GY5] Typed "custom"
[tester::#GY5] ✓ Prompt line matches "$ custom"
[tester::#GY5] Pressed "<TAB>" (expecting autocomplete to "custom_exe_6608")
[your-program] $ customcustom_exe_6608
[tester::#GY5] ^ Line does not match expected value.
[tester::#GY5] Expected: "$ custom_exe_6608 "
[tester::#GY5] Received: "$ customcustom_exe_6608"
[tester::#GY5] Assertion failed.
[tester::#GY5] Test failed

```

Showing that matches[0] does contain custom\_exe\_6608, it just isn’t showing in the test. Maybe it’s not showing in time? Any help would be appreciated! I’m sure I’m missing something silly 🙃

---

<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:** [January 21, 2026, 8:56pm UTC](https://forum.codecrafters.io/t/multiple-completions-wh6-failing-test-case/15813/4 "2026-01-21T20:56:12Z")

</div>

Hey @goose-729, I tried running your code locally, and was able to replicate the issue like this:

1. Typed `code` and `TAB`

2. Typed `cr` and `TAB`

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/2/0/20fedfecefb73fcf87749d823a32ff6417f9ae79.png)

1. Pressed `DEL` a bunch of times, but couldn’t delete the whole command, with `codecrcodecr` stuck in there.

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/e/5/e5eaa4fd4227be5be32ffbbb5335f1f978dbf7f2.png)

Let me know if you’d like help debugging this further.

---

<div class="post-metadata">

**Author:** ![goose-729](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/goose-729/32/32_2.png) [@goose-729](https://forum.codecrafters.io/u/goose-729)\
**Post date:** [January 21, 2026, 10:07pm UTC](https://forum.codecrafters.io/t/multiple-completions-wh6-failing-test-case/15813/6 "2026-01-21T22:07:21Z")

</div>

Ah, apologies, I didn’t realise you could run my code. I had a change on my local that wasn’t pushed. That has been pushed now, hopefully it will fix that issue?

---

<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:** [January 22, 2026, 9:58pm UTC](https://forum.codecrafters.io/t/multiple-completions-wh6-failing-test-case/15813/7 "2026-01-22T21:58:41Z")

</div>

@goose-729 Looks like the `string[]` returned from `GetSuggestions()` is being ignored now.

After some trial and error, I was able to narrow it down to `Separators`. Namely, the `string[]` now works with just a small change: reverting `Separators` to its earlier value:

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/7/7/7773a4c9b71889a5953193fb3ae3a767c4691538.png)

 ![image](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/4/c/4c8be93541c20c73f50ddc9e79905c6f75a70993.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.

Let me know if you’d like a hand debugging this further.

---

<div class="post-metadata">

**Author:** ![goose-729](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.codecrafters.io/goose-729/32/32_2.png) [@goose-729](https://forum.codecrafters.io/u/goose-729)\
**Post date:** [January 23, 2026, 8:52am UTC](https://forum.codecrafters.io/t/multiple-completions-wh6-failing-test-case/15813/8 "2026-01-23T08:52:12Z")

</div>

Awesome, thanks Andy for the help, found a solution with your change (see below if others are interested). Turns out it was something small, just needed a second pair of eyes 👀

 ![Screenshot 2026-01-23 at 09.49.19](https://canada1.discourse-cdn.com/flex003/uploads/codecrafters/original/3X/6/b/6bc32be5f81163d65db9aae7da40030aa898c28b.png)

And thanks for tips for running previous stages, was wondering if there was a way to do that!

🙏

---

<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:** [January 28, 2026, 8:52am UTC](https://forum.codecrafters.io/t/multiple-completions-wh6-failing-test-case/15813/9 "2026-01-28T08:52:33Z")

</div>

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