diff options
| author | Brian Anderson <andersrb@gmail.com> | 2011-05-22 01:35:44 -0400 |
|---|---|---|
| committer | Brian Anderson <andersrb@gmail.com> | 2011-05-22 12:28:27 -0400 |
| commit | 10c904bc6aae5a3a912e396fbb5cd69c1604100c (patch) | |
| tree | ae3cdb848f54f3b71849761371c41c55bc06f983 | |
| parent | 443e1e455756df60c93a71b13dc132e289b7f032 (diff) | |
| download | rust-10c904bc6aae5a3a912e396fbb5cd69c1604100c.tar.gz rust-10c904bc6aae5a3a912e396fbb5cd69c1604100c.zip | |
stdlib: Add regression tests for std::str
| -rw-r--r-- | src/test/run-pass/lib-str.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/run-pass/lib-str.rs b/src/test/run-pass/lib-str.rs index a7c3cac8113..fa4435dce6f 100644 --- a/src/test/run-pass/lib-str.rs +++ b/src/test/run-pass/lib-str.rs @@ -131,6 +131,14 @@ fn test_slice() { 500000u))); } +fn test_ends_with() { + assert (str::ends_with("", "")); + assert (str::ends_with("abc", "")); + assert (str::ends_with("abc", "c")); + assert (!str::ends_with("a", "abc")); + assert (!str::ends_with("", "abc")); +} + fn main() { test_bytes_len(); test_index_and_rindex(); @@ -141,4 +149,5 @@ fn main() { test_connect(); test_to_upper(); test_slice(); + test_ends_with(); } |
