diff --git a/src/libcoretest/result.rs b/src/libcoretest/result.rs index ac8c2b953ae96..9a682d8bd1157 100644 --- a/src/libcoretest/result.rs +++ b/src/libcoretest/result.rs @@ -8,11 +8,11 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -pub fn op1() -> Result { Ok(666) } -pub fn op2() -> Result { Err("sadface") } +fn op1() -> Result { Ok(666) } +fn op2() -> Result { Err("sadface") } #[test] -pub fn test_and() { +fn test_and() { assert_eq!(op1().and(Ok(667)).unwrap(), 667); assert_eq!(op1().and(Err::("bad")).unwrap_err(), "bad"); @@ -23,7 +23,7 @@ pub fn test_and() { } #[test] -pub fn test_and_then() { +fn test_and_then() { assert_eq!(op1().and_then(|i| Ok::(i + 1)).unwrap(), 667); assert_eq!(op1().and_then(|_| Err::("bad")).unwrap_err(), "bad"); @@ -35,7 +35,7 @@ pub fn test_and_then() { } #[test] -pub fn test_or() { +fn test_or() { assert_eq!(op1().or(Ok::<_, &'static str>(667)).unwrap(), 666); assert_eq!(op1().or(Err("bad")).unwrap(), 666); @@ -44,7 +44,7 @@ pub fn test_or() { } #[test] -pub fn test_or_else() { +fn test_or_else() { assert_eq!(op1().or_else(|_| Ok::(667)).unwrap(), 666); assert_eq!(op1().or_else(|e| Err::(e)).unwrap(), 666); @@ -54,13 +54,13 @@ pub fn test_or_else() { } #[test] -pub fn test_impl_map() { +fn test_impl_map() { assert!(Ok::(1).map(|x| x + 1) == Ok(2)); assert!(Err::(1).map(|x| x + 1) == Err(1)); } #[test] -pub fn test_impl_map_err() { +fn test_impl_map_err() { assert!(Ok::(1).map_err(|x| x + 1) == Ok(1)); assert!(Err::(1).map_err(|x| x + 1) == Err(2)); } @@ -89,7 +89,7 @@ fn test_collect() { */ #[test] -pub fn test_fmt_default() { +fn test_fmt_default() { let ok: Result = Ok(100); let err: Result = Err("Err"); @@ -100,7 +100,7 @@ pub fn test_fmt_default() { } #[test] -pub fn test_unwrap_or() { +fn test_unwrap_or() { let ok: Result = Ok(100); let ok_err: Result = Err("Err"); @@ -109,7 +109,7 @@ pub fn test_unwrap_or() { } #[test] -pub fn test_unwrap_or_else() { +fn test_unwrap_or_else() { fn handler(msg: &'static str) -> isize { if msg == "I got this." { 50