Skip to content

Commit 225cdc4

Browse files
apasel422brson
authored andcommitted
add test for eq_slice fix
1 parent 21172ee commit 225cdc4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/libcore/str.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,6 +2230,13 @@ mod tests {
22302230
assert (!eq(&~"foo", &~"bar"));
22312231
}
22322232

2233+
#[test]
2234+
fn test_eq_slice() {
2235+
assert (eq_slice(view("foobar", 0, 3), "foo"));
2236+
assert (eq_slice(view("barfoo", 3, 6), "foo"));
2237+
assert (!eq_slice("foo1", "foo2"));
2238+
}
2239+
22332240
#[test]
22342241
fn test_le() {
22352242
assert (le(&"", &""));

0 commit comments

Comments
 (0)