소스 검색

Added test for trait From<T> for Ratio<T> where T: Clone + Integer.

Wictor Lund 8 년 전
부모
커밋
4bdad38eee
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1 0
      rational/src/lib.rs

+ 1 - 0
rational/src/lib.rs

@@ -745,6 +745,7 @@ mod test {
         assert_eq!(_1_2, Ratio::new(1, 2));
         assert_eq!(_3_2, Ratio::new(3, 2));
         assert_eq!(_NEG1_2, Ratio::new(-1, 2));
+        assert_eq!(_2, From::from(2));
     }
 
     #[test]