15 Commits
Author SHA1 Message Date
Supan Roy 1922c8f2b4 Add additional replace overlap edge case tests (#63)
* add additional replace overlap edge case tests

* Add additional Python compatibility edge case tests
2026-06-13 16:01:32 -07:00
Danny Greenstein 381829c2c1 Match our isupper with python behavior (#55)
* tightening compatbility with python's behavior in edge cases

* a couple of more edge cases
2026-02-23 17:04:14 -08:00
Danny Greenstein 76a2024e13 Merge pull request #30 from niclasr/removestarfix
Add removeprefix and removesuffix to pystring
2023-07-22 19:37:05 -07:00
Larry Gritz cce54a1bcb Revise license formatting to match other modern projects. (#33)
No change to the fact that this project is BSD-3-clause licensed.

But this slight rewording/reformatting:

* Brings the notices in line with the exact wording we use in other
  projects such as OSL.

* Now will be correctly recognized by GitHub and other automated
  license checkers as being EXACTLY the same as the canonical BSD
  3-clause license.

This was approved by SPI legal.
2022-06-08 21:51:45 -07:00
Niclas Rosenvik e8e34d02a6 Add tests for removeprefix and removesuffix 2022-03-04 13:39:47 +01:00
Daniel Greenstein 8c0f1738fc accepting fix proposed in issue #20 - for deadlock in path split when the path ends in a double slash 2019-03-04 02:20:11 +00:00
Daniel Greenstein 3670fab511 testing both posix and nt version of the abspath call 2019-02-24 19:01:53 +00:00
Jeremy Selan c2de99deb4 fix replace on empty strings 2012-10-16 14:31:17 -07:00
Jeremy Selan f38e93591b fix rsplit for non-space characters 2012-10-16 14:30:43 -07:00
Jeremy Selan ae50dda1ea exposed all os::path posix vs. nt varients 2012-04-10 17:05:23 -07:00
Jeremy Selan 6c7eadc6c2 added os::path::abspath 2011-10-25 10:52:49 -07:00
Jeremy Selan fef753074e bugfix : find/rfind dont return bad valid results when start/end points smaller
than the seach string are specified.

Addressed github #7
2011-06-20 18:44:37 -07:00
Jeremy Selan 53e5b88e08 added unittests for pystring::find
This exposes two previously unknown bugs in the pystring::find implementation:

pystring::find("", "") -> -1
    Correct: 0
pystring::find("abcabcabc", "bc", 4, 5) -> 4
    Correct: -1
2011-06-20 16:00:40 -07:00
Jeremy Selan 0f4ab0dd3f bugfix: startswith / endswith does not overflow when suffix size > str size
The previous implementation of startswith / endswith would overflow when the
suffix size > str size, due to an issue with the __substrcmp(str, suffix, lower
) implementation. The updated fix was to re-implement both of these functions looking at the
python 2.7 source, which relies on the _string_tailmatch convenience function.

Addresses issue #2
2011-06-20 15:15:13 -07:00
Jeremy Selan b09b4ae913 added unittest framework
The unittests can be run with the
`make test`
build target.

They currently fail on a single test for pystring::translate as a demonstration
of the unit-tests fail behavior. (This error is a known issue, documented as #3)
2011-06-20 13:39:27 -07:00