Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 18, 2026

TestTree only supported dot (.) as a separator for test name hierarchies. Test names using underscores (e.g., Namespace_Class_Method) were not split into proper tree structures.

Changes

  • TestTree.cs: Added _ to NameSeparators array and introduced ReconstructPath() to preserve original separators in node paths
  • TestTreeTests.cs: Added two test cases verifying underscore-separated names create proper hierarchies and are searchable

Example

var tree = new TestTree();
tree.AddTests(["Namespace_Class_Method"]);

// Creates hierarchy: Namespace -> Class -> Method
var node = tree.FindNodeByPath("Namespace_Class");
// node.FullPath == "Namespace_Class" (preserves original separator)

Mixed separators (Namespace.Class_Method) work as expected, with each separator preserved in the reconstructed path.

Original prompt

This section details on the original issue you should resolve

<issue_title>Failing Test: Asynkron.TestRunner.Tests.TestTreeTests.AddTests_TestsWithUnderscoreSeparators_SplitsCorrectly</issue_title>
<issue_description>## Failing Test

Test: Asynkron.TestRunner.Tests.TestTreeTests.AddTests_TestsWithUnderscoreSeparators_SplitsCorrectly
Display Name: Asynkron.TestRunner.Tests.TestTreeTests.AddTests_TestsWithUnderscoreSeparators_SplitsCorrectly

Error Message

Expected at least 3 levels, got 1

Stack Trace

   at Xunit.Assert.True(Nullable`1 condition, String userMessage) in /_/src/xunit.assert/Asserts/BooleanAsserts.cs:line 146
   at Xunit.Assert.True(Boolean condition, String userMessage) in /_/src/xunit.assert/Asserts/BooleanAsserts.cs:line 128
   at Asynkron.TestRunner.Tests.TestTreeTests.AddTests_TestsWithUnderscoreSeparators_SplitsCorrectly() in /Users/rogerjohansson/git/asynkron/Asynkron.TestRunner/tests/Asynkron.TestRunner.Tests/TestTreeTests.cs:line 74
   at System.Reflection.MethodBaseInvoker.InterpretedInvoke_Method(Object obj, IntPtr* args)
   at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

Other Failing Tests in This Run

  • Asynkron.TestRunner.Tests.TestTreeTests.FindNodeByPath_WorksWithUnderscoreSeparators

Generated by Asynkron.TestRunner at 2026-01-16 11:41:24 UTC
</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI changed the title [WIP] Fix failing test for underscore separators splitting Add underscore separator support to TestTree Jan 18, 2026
Copilot AI requested a review from rogeralsing January 18, 2026 13:09
@rogeralsing rogeralsing mentioned this pull request Jan 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Failing Test: Asynkron.TestRunner.Tests.TestTreeTests.AddTests_TestsWithUnderscoreSeparators_SplitsCorrectly

2 participants