Advertisement
Guest User

Untitled

a guest
Dec 10th, 2019
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 1.30 KB | None | 0 0
  1. #[cfg(test)]
  2. mod tests {
  3.     use super::*;
  4.  
  5.     #[test]
  6.     fn test1() {
  7.         assert_eq!("-6,-3-1,3-5,7-11,14,15,17-20", solution::range_extraction(&[-6,-3,-2,-1,0,1,3,4,5,7,8,9,10,11,14,15,17,18,19,20]));
  8.     }
  9.     #[test]
  10.     fn test2() {
  11.         assert_eq!("-3--1,2,10,15,16,18-20", solution::range_extraction(&[-3,-2,-1,2,10,15,16,18,19,20]));
  12.     }
  13.     #[test]
  14.     fn test3() {
  15.         assert_eq!("1-5", solution::range_extraction(&[1, 2, 3, 4, 5]));
  16.     }
  17.     #[test]
  18.     fn test4() {
  19.         assert_eq!("1,3,5,7,9", solution::range_extraction(&[1, 3, 5, 7, 9]));
  20.     }
  21.     #[test]
  22.     fn test5() {
  23.         assert_eq!("1,3", solution::range_extraction(&[1,3]));
  24.     }
  25.     #[test]
  26.     fn test6() {
  27.         assert_eq!("1-3", solution::range_extraction(&[1, 2, 3]));
  28.     }
  29.     #[test]
  30.     fn test7() {
  31.         assert_eq!("-1-1", solution::range_extraction(&[-1, 0, 1]));
  32.     }
  33.     #[test]
  34.     fn test8() {
  35.         assert_eq!("-9--7,-5--1,1,2,4", solution::range_extraction(&[-9, -8, -7, -5, -4, -3, -2, -1, 1, 2, 4]));
  36.     }
  37.     #[test]
  38.     fn test9() {
  39.         assert_eq!("1-10,12", solution::range_extraction(&[1,2,3,4,5,6,7,8,9,10,12]));
  40.     }
  41.     #[test]
  42.     fn test10() {
  43.         assert_eq!("-9--1,1", solution::range_extraction(&[-9,-8,-7,-6,-5,-4,-3,-2,-1,1]));
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement