Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 18, 2026

TestTree only split test names on dots (.), preventing proper hierarchical organization of tests using underscore-based naming conventions like Method_WhenCondition_ThenResult.

Changes

  • TestTree.cs: Added '_' to NameSeparators array alongside '.'
  • TestTreeTests.cs: Added tests verifying underscore separation behavior

Example

var tree = new TestTree();
tree.AddTests(["Namespace.Class.Method_WhenCondition_ThenResult"]);

// Before: Single node "Method_WhenCondition_ThenResult"
// After:  Hierarchy Method → WhenCondition → ThenResult

var node = tree.FindNodeByPath("Namespace.Class.Method");
Assert.Equal("Method", node.Name);  // Now passes

This enables TestTree to handle common test naming patterns (AAA/GWT) without breaking existing dot-separated hierarchies.

Original prompt

This section details on the original issue you should resolve

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

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

Error Message

Assert.Equal() Failure: Strings differ
Expected: "Method"
Actual:   "Method_WhenCondition_ThenResult"
                 ↑ (pos 6)

Stack Trace

   at Xunit.Assert.Equal(ReadOnlySpan`1 expectedSpan, ReadOnlySpan`1 actualSpan, Boolean ignoreCase, Boolean ignoreLineEndingDifferences, Boolean ignoreWhiteSpaceDifferences, Boolean ignoreAllWhiteSpace) in /_/src/xunit.assert/Asserts/SpanAsserts.cs:line 617
   at Xunit.Assert.Equal(String expected, String actual, Boolean ignoreCase, Boolean ignoreLineEndingDifferences, Boolean ignoreWhiteSpaceDifferences, Boolean ignoreAllWhiteSpace) in /_/src/xunit.assert/Asserts/StringAsserts.cs:line 333
   at Xunit.Assert.Equal(String expected, String actual) in /_/src/xunit.assert/Asserts/StringAsserts.cs:line 302
   at Asynkron.TestRunner.Tests.TestTreeTests.FindNodeByPath_WorksWithUnderscoreSeparators() in /Users/rogerjohansson/git/asynkron/Asynkron.TestRunner/tests/Asynkron.TestRunner.Tests/TestTreeTests.cs:line 243
   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.AddTests_TestsWithUnderscoreSeparators_SplitsCorrectly

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

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix failing test for FindNodeByPath with underscore separators Add underscore separator support to TestTree for test name hierarchies Jan 18, 2026
Copilot AI requested a review from rogeralsing January 18, 2026 13:05
@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.FindNodeByPath_WorksWithUnderscoreSeparators

2 participants