BigEd / python-on-a-chip

Automatically exported from code.google.com/p/python-on-a-chip
Other
1 stars 3 forks source link

Fix string.find() #133

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
System test t047 has this:

assert string.find("","") == -1
assert string.find("","a") == -1
assert string.find("a","") == -1
assert string.find("","\0") == -1
assert string.find("\0","\0") == -1
assert string.find("\0","") == -1

But the values that match Python 2.6 are this:

assert string.find("","") == 0
assert string.find("","a") == -1
assert string.find("a","") == 0
assert string.find("","\0") == -1
assert string.find("\0","\0") == 0
assert string.find("\0","") == 0

Original issue reported on code.google.com by dwhall...@gmail.com on 2 Sep 2010 at 7:25

GoogleCodeExporter commented 9 years ago
r592
- Adjusted system test t047.py (per above)
- Added two new tests in t047.py
- Fixed algorithm in find() in src/lib/string.py

All tests pass.  Mainlined directly.

Original comment by dwhall...@gmail.com on 2 Sep 2010 at 7:46