about summary refs log tree commit diff
path: root/src/libcore/str.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/str.rs')
-rw-r--r--src/libcore/str.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/libcore/str.rs b/src/libcore/str.rs
index 722d62626a6..0a5211137b3 100644
--- a/src/libcore/str.rs
+++ b/src/libcore/str.rs
@@ -2674,9 +2674,11 @@ mod tests {
 
     #[test]
     fn test_to_lower() {
-        assert ~"" == map(~"", |c| libc::tolower(c as c_char) as char);
-        assert ~"ymca" == map(~"YMCA",
-                             |c| libc::tolower(c as c_char) as char);
+        unsafe {
+            assert ~"" == map(~"", |c| libc::tolower(c as c_char) as char);
+            assert ~"ymca" == map(~"YMCA",
+                                 |c| libc::tolower(c as c_char) as char);
+        }
     }
 
     #[test]
@@ -3192,9 +3194,11 @@ mod tests {
 
     #[test]
     fn test_map() {
-        assert ~"" == map(~"", |c| libc::toupper(c as c_char) as char);
-        assert ~"YMCA" == map(~"ymca",
-                              |c| libc::toupper(c as c_char) as char);
+        unsafe {
+            assert ~"" == map(~"", |c| libc::toupper(c as c_char) as char);
+            assert ~"YMCA" == map(~"ymca",
+                                  |c| libc::toupper(c as c_char) as char);
+        }
     }
 
     #[test]