Skip to content

Commit 10c904b

Browse files
committed
stdlib: Add regression tests for std::str
1 parent 443e1e4 commit 10c904b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/test/run-pass/lib-str.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,14 @@ fn test_slice() {
131131
500000u)));
132132
}
133133

134+
fn test_ends_with() {
135+
assert (str::ends_with("", ""));
136+
assert (str::ends_with("abc", ""));
137+
assert (str::ends_with("abc", "c"));
138+
assert (!str::ends_with("a", "abc"));
139+
assert (!str::ends_with("", "abc"));
140+
}
141+
134142
fn main() {
135143
test_bytes_len();
136144
test_index_and_rindex();
@@ -141,4 +149,5 @@ fn main() {
141149
test_connect();
142150
test_to_upper();
143151
test_slice();
152+
test_ends_with();
144153
}

0 commit comments

Comments
 (0)