Skip to content

Conversation

@brthom
Copy link
Contributor

@brthom brthom commented Apr 11, 2025

Addresses #245624

This PR improves test item sorting in Testing Explorer by replacing naive string comparison with compareFileNames() from vs/base/common/comparers.ts. This change ensures that files like test_1.py, test_2.py, test_10.py are sorted numerically instead of lexically. This fix also maintains the behavior of #173350, which fixes the behavior of #163449.

Reproduction steps before fix:

  1. Create files test_1.py, test_2.py, test_10.py
  2. Observe Test Explorer sorts them lexically: test_1.py, test_10.py, test_2.py

Reproduction steps after fix:

  1. Create files as previous
  2. Observe Test Explorer sorts them naturally, consistent with File Explorer

Location of change: vs/workbench/contrib/testing/browser/testingExplorerView.ts

@connor4312
Copy link
Member

Thanks!

@connor4312 connor4312 enabled auto-merge (squash) April 11, 2025 23:31
@vs-code-engineering vs-code-engineering bot added this to the April 2025 milestone Apr 11, 2025
@connor4312 connor4312 merged commit 8e6295b into microsoft:main Apr 11, 2025
7 checks passed
@brthom brthom deleted the fix-test-sorting branch April 12, 2025 01:16
@brthom brthom restored the fix-test-sorting branch April 12, 2025 01:16
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators May 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants