diff options
| author | Kevin Cantu <me@kevincantu.org> | 2012-02-01 04:30:19 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-02-01 21:56:53 -0800 |
| commit | fc9169f09c8999040bc2bdb313dd44fbb70472f8 (patch) | |
| tree | 0670644f872b4df144e5da82c716d266eb7fe95d /src/libcore | |
| parent | 8f367ebfeb4f0b897b386f5c74c4f329fb8cbd54 (diff) | |
| download | rust-fc9169f09c8999040bc2bdb313dd44fbb70472f8.tar.gz rust-fc9169f09c8999040bc2bdb313dd44fbb70472f8.zip | |
Make the tests work, too
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/str.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs index 742d31fea3e..c5e037b276d 100644 --- a/src/libcore/str.rs +++ b/src/libcore/str.rs @@ -841,6 +841,8 @@ Function: index Returns the index of the first matching byte. Returns -1 if no match is found. + +FIXME: UTF-8 */ fn index(s: str, c: u8) -> int { let i: int = 0; @@ -853,6 +855,8 @@ Function: rindex Returns the index of the last matching byte. Returns -1 if no match is found. + +FIXME: UTF-8 */ fn rindex(s: str, c: u8) -> int { let n: int = byte_len(s) as int; @@ -874,6 +878,8 @@ needle - The string to look for Returns: The index of the first occurance of `needle`, or -1 if not found. + +FIXME: UTF-8? */ fn find(haystack: str, needle: str) -> int { let haystack_len: int = byte_len(haystack) as int; @@ -1589,9 +1595,9 @@ mod tests { #[test] fn test_unsafe_slice() unsafe { - assert (eq("ab", slice("abc", 0u, 2u))); - assert (eq("bc", slice("abc", 1u, 3u))); - assert (eq("", slice("abc", 1u, 1u))); + assert (eq("ab", unsafe::slice_bytes("abc", 0u, 2u))); + assert (eq("bc", unsafe::slice_bytes("abc", 1u, 3u))); + assert (eq("", unsafe::slice_bytes("abc", 1u, 1u))); fn a_million_letter_a() -> str { let i = 0; let rs = ""; |
