feat: add locale-aware tests for sort debug key annotations
Split the existing `test_debug_key_annotations` into two tests: one for basic functionality and another for locale-specific behavior to handle conditional execution based on environment variables. Extracted a new helper function `debug_key_annotation_output` to generate debug output, improving test modularity and reducing code duplication. This enhances test coverage for debug key annotations in different numeric locales.
62c9299
12 days ago
by mattsu2020
-0.03%
refactor(test): optimize string building in debug_key_annotation_output for efficiency
Rework the `number` helper function to use a mutable String buffer with `writeln!` macro
instead of collecting intermediary vectors with `map` and `collect`. This reduces allocations
and improves performance in test output generation, building the numbered output directly
without extra string concatenations.
55b7884
12 days ago
by mattsu2020
+0.03%
refactor(tests): improve formatting and readability in sort test helpers
- Reformatted command-line arguments in test_debug_key_annotations_locale to fit on fewer lines
- Wrapped run_sort calls in debug_key_annotation_output for better code structure
- Minor reordering of output.push_str blocks for consistency and clarity
d7989cc
12 days ago
by mattsu2020
0%
refactor(test): embed expected debug key annotation outputs as constants
Replace fixture file reads with inline constants in test functions for
debug key annotations and locale variants. This makes the tests more
self-contained by removing dependencies on external fixture files.
b0f6290
12 days ago
by mattsu2020
0%
Merge branch 'main' into sort-debug-keys
0eb8bee
5 days ago
by mattsu2020
+0.01%
Merge branch 'main' into sort-debug-keys
663f4bf
4 days ago
by mattsu2020
-0.01%
feat(sort): extract count_non_null_bytes for debug alignment
Add a helper function `count_non_null_bytes` to count bytes in a slice while ignoring embedded NULs. This improves code reusability and is used in debug underline output to ensure proper alignment by filtering NUL characters that may be present in selection strings. Replaces inline counting logic in two locations within the `Line` implementation.