use convert_base::Convert; #[test] fn low_to_high_unaligned_big () { assert_eq![ Convert::new(16,300).convert::(&vec![0xb,0x9,0x3,0xc]), vec![275,166], "c39b@16 => @300" ]; assert_eq![ Convert::new(300,500).convert::(&vec![50,288,19,263,6]), vec![450,92,311,445], "@300 => @500" ]; assert_eq![ Convert::new(10,36052000).convert::( &vec![1,2,3,4,5,6,7,8,9,0,9,8,7,6,5,4,3,2,1, 2,3,4,5,6,7,8,9,0,9,8,7,6,5,4,3,2,1] ), vec![8242321,7535681,4301677,10786674,730798] ]; } #[test] fn high_to_low_unaligned_big () { assert_eq![ Convert::new(300,16).convert::(&vec![275,166]), vec![0xb,0x9,0x3,0xc], "@300 => @16" ]; assert_eq![ Convert::new(500,300).convert::(&vec![450,92,311,445]), vec![50,288,19,263,6], "@500 => @300" ]; assert_eq![ Convert::new(36052000,10).convert::( &vec![8242321,7535681,4301677,10786674,730798] ), vec![1,2,3,4,5,6,7,8,9,0,9,8,7,6,5,4,3,2,1, 2,3,4,5,6,7,8,9,0,9,8,7,6,5,4,3,2,1] ]; }