• Home
  • Raw
  • Download

Lines Matching refs:assert_parse

1627   macro_rules! assert_parse(  macro
1636 assert_parse!(be_i8(&[0x00][..]), Ok((&b""[..], 0))); in i8_tests()
1637 assert_parse!(be_i8(&[0x7f][..]), Ok((&b""[..], 127))); in i8_tests()
1638 assert_parse!(be_i8(&[0xff][..]), Ok((&b""[..], -1))); in i8_tests()
1639 assert_parse!(be_i8(&[0x80][..]), Ok((&b""[..], -128))); in i8_tests()
1640 assert_parse!(be_i8(&[][..]), Err(Err::Incomplete(Needed::new(1)))); in i8_tests()
1645 assert_parse!(be_i16(&[0x00, 0x00][..]), Ok((&b""[..], 0))); in i16_tests()
1646 assert_parse!(be_i16(&[0x7f, 0xff][..]), Ok((&b""[..], 32_767_i16))); in i16_tests()
1647 assert_parse!(be_i16(&[0xff, 0xff][..]), Ok((&b""[..], -1))); in i16_tests()
1648 assert_parse!(be_i16(&[0x80, 0x00][..]), Ok((&b""[..], -32_768_i16))); in i16_tests()
1649 assert_parse!(be_i16(&[][..]), Err(Err::Incomplete(Needed::new(2)))); in i16_tests()
1650 assert_parse!(be_i16(&[0x00][..]), Err(Err::Incomplete(Needed::new(1)))); in i16_tests()
1655 assert_parse!(be_u24(&[0x00, 0x00, 0x00][..]), Ok((&b""[..], 0))); in u24_tests()
1656 assert_parse!(be_u24(&[0x00, 0xFF, 0xFF][..]), Ok((&b""[..], 65_535_u32))); in u24_tests()
1657 assert_parse!( in u24_tests()
1661 assert_parse!(be_u24(&[][..]), Err(Err::Incomplete(Needed::new(3)))); in u24_tests()
1662 assert_parse!(be_u24(&[0x00][..]), Err(Err::Incomplete(Needed::new(2)))); in u24_tests()
1663 assert_parse!( in u24_tests()
1671 assert_parse!(be_i24(&[0xFF, 0xFF, 0xFF][..]), Ok((&b""[..], -1_i32))); in i24_tests()
1672 assert_parse!(be_i24(&[0xFF, 0x00, 0x00][..]), Ok((&b""[..], -65_536_i32))); in i24_tests()
1673 assert_parse!( in i24_tests()
1677 assert_parse!(be_i24(&[][..]), Err(Err::Incomplete(Needed::new(3)))); in i24_tests()
1678 assert_parse!(be_i24(&[0x00][..]), Err(Err::Incomplete(Needed::new(2)))); in i24_tests()
1679 assert_parse!( in i24_tests()
1687 assert_parse!(be_i32(&[0x00, 0x00, 0x00, 0x00][..]), Ok((&b""[..], 0))); in i32_tests()
1688 assert_parse!( in i32_tests()
1692 assert_parse!(be_i32(&[0xff, 0xff, 0xff, 0xff][..]), Ok((&b""[..], -1))); in i32_tests()
1693 assert_parse!( in i32_tests()
1697 assert_parse!(be_i32(&[][..]), Err(Err::Incomplete(Needed::new(4)))); in i32_tests()
1698 assert_parse!(be_i32(&[0x00][..]), Err(Err::Incomplete(Needed::new(3)))); in i32_tests()
1699 assert_parse!( in i32_tests()
1703 assert_parse!( in i32_tests()
1711 assert_parse!( in i64_tests()
1715 assert_parse!( in i64_tests()
1719 assert_parse!( in i64_tests()
1723 assert_parse!( in i64_tests()
1727 assert_parse!(be_i64(&[][..]), Err(Err::Incomplete(Needed::new(8)))); in i64_tests()
1728 assert_parse!(be_i64(&[0x00][..]), Err(Err::Incomplete(Needed::new(7)))); in i64_tests()
1729 assert_parse!( in i64_tests()
1733 assert_parse!( in i64_tests()
1737 assert_parse!( in i64_tests()
1741 assert_parse!( in i64_tests()
1745 assert_parse!( in i64_tests()
1749 assert_parse!( in i64_tests()
1757 assert_parse!( in i128_tests()
1766 assert_parse!( in i128_tests()
1778 assert_parse!( in i128_tests()
1787 assert_parse!( in i128_tests()
1799 assert_parse!(be_i128(&[][..]), Err(Err::Incomplete(Needed::new(16)))); in i128_tests()
1800 assert_parse!(be_i128(&[0x00][..]), Err(Err::Incomplete(Needed::new(15)))); in i128_tests()
1801 assert_parse!( in i128_tests()
1805 assert_parse!( in i128_tests()
1809 assert_parse!( in i128_tests()
1813 assert_parse!( in i128_tests()
1817 assert_parse!( in i128_tests()
1821 assert_parse!( in i128_tests()
1825 assert_parse!( in i128_tests()
1829 assert_parse!( in i128_tests()
1833 assert_parse!( in i128_tests()
1837 assert_parse!( in i128_tests()
1841 assert_parse!( in i128_tests()
1845 assert_parse!( in i128_tests()
1849 assert_parse!( in i128_tests()
1855 assert_parse!( in i128_tests()
1866 assert_parse!(le_i8(&[0x00][..]), Ok((&b""[..], 0))); in le_i8_tests()
1867 assert_parse!(le_i8(&[0x7f][..]), Ok((&b""[..], 127))); in le_i8_tests()
1868 assert_parse!(le_i8(&[0xff][..]), Ok((&b""[..], -1))); in le_i8_tests()
1869 assert_parse!(le_i8(&[0x80][..]), Ok((&b""[..], -128))); in le_i8_tests()
1874 assert_parse!(le_i16(&[0x00, 0x00][..]), Ok((&b""[..], 0))); in le_i16_tests()
1875 assert_parse!(le_i16(&[0xff, 0x7f][..]), Ok((&b""[..], 32_767_i16))); in le_i16_tests()
1876 assert_parse!(le_i16(&[0xff, 0xff][..]), Ok((&b""[..], -1))); in le_i16_tests()
1877 assert_parse!(le_i16(&[0x00, 0x80][..]), Ok((&b""[..], -32_768_i16))); in le_i16_tests()
1882 assert_parse!(le_u24(&[0x00, 0x00, 0x00][..]), Ok((&b""[..], 0))); in le_u24_tests()
1883 assert_parse!(le_u24(&[0xFF, 0xFF, 0x00][..]), Ok((&b""[..], 65_535_u32))); in le_u24_tests()
1884 assert_parse!( in le_u24_tests()
1892 assert_parse!(le_i24(&[0xFF, 0xFF, 0xFF][..]), Ok((&b""[..], -1_i32))); in le_i24_tests()
1893 assert_parse!(le_i24(&[0x00, 0x00, 0xFF][..]), Ok((&b""[..], -65_536_i32))); in le_i24_tests()
1894 assert_parse!( in le_i24_tests()
1902 assert_parse!(le_i32(&[0x00, 0x00, 0x00, 0x00][..]), Ok((&b""[..], 0))); in le_i32_tests()
1903 assert_parse!( in le_i32_tests()
1907 assert_parse!(le_i32(&[0xff, 0xff, 0xff, 0xff][..]), Ok((&b""[..], -1))); in le_i32_tests()
1908 assert_parse!( in le_i32_tests()
1916 assert_parse!( in le_i64_tests()
1920 assert_parse!( in le_i64_tests()
1924 assert_parse!( in le_i64_tests()
1928 assert_parse!( in le_i64_tests()
1936 assert_parse!( in le_i128_tests()
1945 assert_parse!( in le_i128_tests()
1957 assert_parse!( in le_i128_tests()
1966 assert_parse!( in le_i128_tests()
1982 assert_parse!(be_f32(&[0x00, 0x00, 0x00, 0x00][..]), Ok((&b""[..], 0_f32))); in be_f32_tests()
1983 assert_parse!( in be_f32_tests()
1991 assert_parse!( in be_f64_tests()
1995 assert_parse!( in be_f64_tests()
2003 assert_parse!(le_f32(&[0x00, 0x00, 0x00, 0x00][..]), Ok((&b""[..], 0_f32))); in le_f32_tests()
2004 assert_parse!( in le_f32_tests()
2012 assert_parse!( in le_f64_tests()
2016 assert_parse!( in le_f64_tests()
2024 assert_parse!( in hex_u32_tests()
2028 assert_parse!(hex_u32(&b"ff;"[..]), Ok((&b";"[..], 255))); in hex_u32_tests()
2029 assert_parse!(hex_u32(&b"1be2;"[..]), Ok((&b";"[..], 7138))); in hex_u32_tests()
2030 assert_parse!(hex_u32(&b"c5a31be2;"[..]), Ok((&b";"[..], 3_315_801_058))); in hex_u32_tests()
2031 assert_parse!(hex_u32(&b"C5A31be2;"[..]), Ok((&b";"[..], 3_315_801_058))); in hex_u32_tests()
2032 assert_parse!(hex_u32(&b"00c5a31be2;"[..]), Ok((&b"e2;"[..], 12_952_347))); in hex_u32_tests()
2033 assert_parse!( in hex_u32_tests()
2037 assert_parse!(hex_u32(&b"ffffffff;"[..]), Ok((&b";"[..], 4_294_967_295))); in hex_u32_tests()
2038 assert_parse!(hex_u32(&b"0x1be2;"[..]), Ok((&b"x1be2;"[..], 0))); in hex_u32_tests()
2039 assert_parse!(hex_u32(&b"12af"[..]), Err(Err::Incomplete(Needed::new(1)))); in hex_u32_tests()
2072 assert_parse!(recognize_float(&larger[..]), Ok((";", test))); in float_test()
2074 assert_parse!(float(larger.as_bytes()), Ok((&b";"[..], expected32))); in float_test()
2075 assert_parse!(float(&larger[..]), Ok((";", expected32))); in float_test()
2077 assert_parse!(double(larger.as_bytes()), Ok((&b";"[..], expected64))); in float_test()
2078 assert_parse!(double(&larger[..]), Ok((";", expected64))); in float_test()
2082 assert_parse!( in float_test()