summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Don't bother with ISO8858-1 localeHEADmainSeth Morton2023-04-181-5/+2
| | | | Just use UTF8.
* Reduce the finger pointing at BSDSeth Morton2023-04-181-8/+5
| | | | Turns out a fair amount of the problems were with natsort itself.
* Add FreeBSD fix for locale failureSeth Morton2023-03-011-1/+16
| | | | | | | | | | FreeBSD seems to throw an OSError when locale.strxfrm is given 'Å', which is surprising behavior. Well, maybe not, considering how many bugs I have found with FreeBSD's implementation of locale over the course of natsort development. Anyway, we just ignore any input that causes locale.strxfrm to barf in our tests.
* Add FreeBSD failing test exampleSeth Morton2023-03-011-0/+1
|
* Fixed bug in NANLAST/NANFIRSTSeth Morton2023-02-272-7/+7
| | | | | | | The previous code change to make NaN and None ordering consistent made it so that NANLAST did not put NaN last. Oops. It also had made it so that NaN wasn't first for NANFIRST. Oops.
* Add presort to natsorted and friendsSeth Morton2023-02-274-0/+45
| | | | | | This will sort the collection as strings before sorting with the natsort algorithm. This ensures that strings that are different but represent the same numerical value get sorted independent of input order.
* Ensure None, NaN, and Infinity are sorted consistentlySeth Morton2023-02-262-14/+35
| | | | | | | Internally, these may be translated to the same value, so they will be output in the same order they were input, which could lead to suprise. This commit ensures the order is always consistent.
* Solve static analysis errorsSeth Morton2023-02-261-3/+8
|
* Enable new, more performant fastnumbersSeth Morton2023-02-263-23/+24
| | | | | | The new version can convert the entire mapping internally, so we use that if possible. A new wrapper for this new function is introduced to make the calling code consistent.
* Fix static analysis warningSeth Morton2023-02-261-1/+2
|
* Run with newest blackSeth Morton2023-02-261-1/+3
|
* Simplify type hints for public functionsSeth Morton2022-09-012-4/+3
| | | | | | | | | ...and to some degree private as well. Previously, the declared hints for natsort were too restrictive. Generics and protocols are now utilized to make the type hints more "open" which is more realistic, since more than just basic types can be sorted.
* Formatting fixGilthans2022-08-161-1/+5
|
* Treat paths as strings in StrParserGilthans2022-08-111-0/+6
|
* Add tests to demonstrate the PATH ext bugSeth Morton2022-01-292-4/+36
| | | | | | | I'm not sure sure it is *actually* a bug, but the PATH algorithm's way of splitting extensions was over-zealous and in practice will split off more extensions that is probably desired. To fix this, we will need to add a heuristic, but this commit adds tests to demonstrate the problem.
* Add handling for '.' when splitting pathsSeth Morton2021-12-141-0/+8
| | | | | | | pathlib.Path(".").parts returns an empty tuple. This is unexpected, and caused a tuple unpacking statement to fail. The solution is to catch the ValueError from tuple unpacking and manually construct the return values.
* Add new cs_CZ locale into the CI environmentSeth Morton2021-12-101-0/+3
|
* Add tests for the cs_CZ regressionSeth Morton2021-12-092-0/+24
| | | | This ensures that going forward this won't not sort correctly.
* Fix other bugs introduced in the shuffleSeth Morton2021-10-2910-20/+22
|
* Rename some typesSeth Morton2021-10-2812-49/+49
|
* Add type annotations to testsSeth Morton2021-10-2819-210/+324
| | | | | | | | That was... a lot. There are still errors in the os_sorted tests, but that requires me to rethink some typing decisions in the main code so that will be for a future commit.
* Add type hints to "minor" filesSeth Morton2021-10-261-1/+0
| | | | | | The compat and __main__ files have had type hints added. The unicode_* files all do not need type hints (because all variables are deducable), same with the ns_enum file.
* The ns enum actually now is a python enumSeth Morton2021-10-241-3/+8
| | | | | | | | | I have been wanting to do this for quite some time, but needed the functionality of the IntEnum for backwards-compatibility. Now that Python 3.5 is no longer supported, the IntEnum can be used and the definition of ns is far simpler than it used to be. This plays nice with mypy also, which is the driving change.
* Fix warnings during tests, closes issue #126Seth Morton2020-11-261-8/+7
| | | | | | | - The SemVer function used in the examples was deprecated, so the suggested alternative is now used instead. - Hypothesis apparently doesn't play well with function-scoped fixtures and has started warning about it - those tests have been rewritten.
* Run blackSeth Morton2020-11-227-16/+11
| | | | | It turns out I had an error in the Travis-CI black invocation that cause it to not actually catch formatting errors. Oops!
* Add more instructionsSeth Morton2020-11-191-0/+2
|
* Test that checks unicode number presence won't crater testsSeth Morton2020-11-191-16/+23
| | | | Instead of failing, it only raises a warning.
* Improve testing clarity and maintainablilitywindows-exporer-sortingSeth Morton2020-11-181-11/+16
|
* Add a test for key with os_sortedSeth Morton2020-11-171-0/+6
|
* Fully implement OS sorting on all platformsSeth Morton2020-11-171-0/+194
| | | | | ICU is used to sort on UNIX-based platforms. If not given, the results are OK, but not exactly what you would expect.
* Change winsorted to os_sortedSeth Morton2020-11-171-22/+0
| | | | | | | This will work on any operating system. The current implementation is known to not work on non-Windows. Future commits will fix this.
* Initial implementation of winsortedSeth Morton2020-11-171-0/+22
| | | | Basic tests
* Treat None like NaN so it gets sorted robustlySeth Morton2020-11-151-4/+6
| | | | | | This will prevent TypeErrors. This closes issue #117.
* Add tests to challenge de localeSeth Morton2020-01-271-0/+14
| | | | | These tests make sure the locale number formatting regex works correctly.
* Include a test for issue #109Seth Morton2020-01-271-0/+8
| | | | | This test highlights the bug, and its presence ensures it does not occur again.
* Fix bug caused by pytest-mocker API being removedSeth Morton2020-01-061-6/+6
| | | | | | | mocker.patch no longer supports context managers. Not sure why I was using it in a context manager in the first place... This closes issue #107.
* Re-remove Python 2.7 support.Seth Morton2019-11-1317-185/+43
|
* Revert removal of Python 2.7 in one commitThis is to make a release that ↵Seth Morton2019-11-1317-43/+185
| | | | supports Python 3.8 and Python 2.7. Thiscommit can be reverted to then remove 2.7 support again.
* Merge branch 'master' into drop-python2-supportSeth Morton2019-11-103-2/+32
|\ | | | | | | Had to resolve addition of numeric_regex_chooser, and version.
| * Merge pull request #102 from SethMMorton/document-unitsSeth Morton2019-11-092-0/+30
| |\ | | | | | | | | | This pull request adds an example of how to sort based on units, and also exposes a new function that helps building custom functions easier.
| | * Disable too slow hypothesis health checks globallySeth Morton2019-11-091-0/+10
| | |
| | * Revert "Disabled hypothesis HealthCheck on certain tests"Seth Morton2019-11-092-5/+3
| | | | | | | | | | | | This reverts commit af9e242433a0df387ba0ae5b123f9f590aefbd46.
| | * Disabled hypothesis HealthCheck on certain testsdocument-unitsSeth Morton2019-11-092-3/+5
| | | | | | | | | | | | | | | For some reason, some tests are deemed "too slow" by hypothesis and cause test failure.
| | * Add tests for new public methodSeth Morton2019-11-071-0/+20
| | |
| * | Fix typo "the the"Jon Dufresne2019-06-201-2/+2
| |/
* | Remove compat.py23 compatibility layerSeth M Morton2019-03-0312-71/+26
| | | | | | | | This resolves *most* of the remaining Python 2 compatibility code.
* | Remove nat_cmp functionSeth M Morton2019-03-031-83/+0
| | | | | | | | cmp is Python 2 only.
* | Remove pathlib compatibility layerSeth M Morton2019-03-032-15/+17
| | | | | | | | | | | | | | | | pathlib comes with Python 3.4 stdlib, so no need to add a compatibility layer. The path_splitter function has been re-written in terms of pathlib since that is now guaranteed to exist. Much simpler.
* | Remove all __future__ importsSeth M Morton2019-03-0316-16/+0
|/ | | | No longer needed when supporting Python 2 is no dropped.
* Fix path splitter issue on WindowsSeth Morton2019-02-271-2/+4
| | | | | | | | | | If a unix-style absolute path is given to the path_splitter on Windows, the first element was a unix-style path separator and not a Windows path sparator. This has been fixed. The docstring has updated to be true for all OSes. Unit tests are updated to account for this change.