]> git.lizzy.rs Git - rust.git/commitdiff
add test for eq_slice fix
authorAndrew Paseltiner <apaseltiner@gmail.com>
Mon, 3 Sep 2012 17:47:10 +0000 (13:47 -0400)
committerBrian Anderson <banderson@mozilla.com>
Tue, 4 Sep 2012 18:27:11 +0000 (11:27 -0700)
src/libcore/str.rs

index 0bb655c3f7968575c3c011264ef8189c487a0206..c450694148878aed120659bba1355540859123d7 100644 (file)
@@ -2230,6 +2230,13 @@ fn test_eq() {
         assert (!eq(&~"foo", &~"bar"));
     }
 
+    #[test]
+    fn test_eq_slice() {
+        assert (eq_slice(view("foobar", 0, 3), "foo"));
+        assert (eq_slice(view("barfoo", 3, 6), "foo"));
+        assert (!eq_slice("foo1", "foo2"));
+    }
+
     #[test]
     fn test_le() {
         assert (le(&"", &""));