about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorAndrew Paseltiner <apaseltiner@gmail.com>2012-09-03 13:47:10 -0400
committerBrian Anderson <banderson@mozilla.com>2012-09-04 11:27:11 -0700
commit225cdc4894638ea36b44dec8605fc357db191e64 (patch)
tree880297586786a9e82954eec7c942dc0a7bf210cb /src/libcore
parent21172ee2808d51510d79b7a7b820cda0bd233986 (diff)
add test for eq_slice fix
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/str.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 0bb655c3f79..c4506941488 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -2231,6 +2231,13 @@ mod tests {
     }
 
     #[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(&"", &""));
         assert (le(&"", &"foo"));