diff options
author | Seth Morton <seth.m.morton@gmail.com> | 2023-02-27 00:40:15 -0800 |
---|---|---|
committer | Seth Morton <seth.m.morton@gmail.com> | 2023-02-27 00:40:15 -0800 |
commit | 99a252e445a75a115431ee8fa18f487375ca9d20 (patch) | |
tree | 150a471469b36a9b03b0012303aa9c91cae4aeb6 /tests/test_natsorted_convenience.py | |
parent | e778c1742fc94766b42110580809795605ca3c88 (diff) | |
parent | 92969665342450fb450904776a59bd8406dfe65a (diff) | |
download | natsort-99a252e445a75a115431ee8fa18f487375ca9d20.tar.gz |
Merge branch 'introduce-consistent-sorting-for-corner-cases'
Diffstat (limited to 'tests/test_natsorted_convenience.py')
-rw-r--r-- | tests/test_natsorted_convenience.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/test_natsorted_convenience.py b/tests/test_natsorted_convenience.py index 0b2cd75..81bdf5c 100644 --- a/tests/test_natsorted_convenience.py +++ b/tests/test_natsorted_convenience.py @@ -88,6 +88,13 @@ def test_index_natsorted_applies_key_function_before_sorting() -> None: assert index_natsorted(given, key=itemgetter(1)) == expected +def test_index_natsorted_can_presort() -> None: + expected = [2, 0, 3, 1] + given = ["a1", "a1.4500", "a01", "a1.45"] + result = index_natsorted(given, alg=ns.FLOAT | ns.PRESORT) + assert result == expected + + def test_index_realsorted_is_identical_to_index_natsorted_with_real_alg( float_list: List[str], ) -> None: |