arr.rs 560 B

123456789101112131415161718192021222324252627
  1. #[macro_use]
  2. extern crate generic_array;
  3. extern crate typenum;
  4. #[test]
  5. fn empty_without_trailing_comma() {
  6. let ar = arr![u8; ];
  7. assert_eq!(format!("{:x}", ar), "");
  8. }
  9. #[test]
  10. fn empty_with_trailing_comma() {
  11. let ar = arr![u8; , ];
  12. assert_eq!(format!("{:x}", ar), "");
  13. }
  14. #[test]
  15. fn without_trailing_comma() {
  16. let ar = arr![u8; 10, 20, 30];
  17. assert_eq!(format!("{:x}", ar), "0a141e");
  18. }
  19. #[test]
  20. fn with_trailing_comma() {
  21. let ar = arr![u8; 10, 20, 30, ];
  22. assert_eq!(format!("{:x}", ar), "0a141e");
  23. }