mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
* PyBytes.title should be ASCII-only. * Use icu_casemap over unicode-casing for titles `icu_casemap` is consistently maintained, official, and tracks the latest Unicode versions. RustPython is also using other `icu4x` crates, so using `icu_casemap` is more consistent. As with islower and isupper, tracking the latest Unicode version is important because character definitions shift over time which causes discrepancies between RustPython and CPython. This commit fixes title(). * Use icu_casemap for capitalize() I dropped unicode-casing because it's cleaner to use icu4x for everything. `icu4x` will also stay up to date whereas unicode-casing will need to be periodically updated with new Unicode tables. Dropping unicode-casing also removes some binary bloat due to the tables. `capitalize()` mimics CPython behavior more closely now as well. Notably, I implemented CPython's sigma edge case handler. * Match CPython's title() exactly
Test snippets
This directory contains two sets of test snippets which can be run in Python.
The snippets/ directory contains functional tests, and the benchmarks/
directory contains snippets for use in benchmarking RustPython's performance.
Setup
Our testing depends on pytest, which you can install using pip.
Running
Simply run pytest -v in this directory, and the tests should run (and hopefully
pass). If it hangs for a long time, that's because it's building RustPython in
release mode, which should take less time than it would to run every test
snippet with RustPython compiled in debug mode.