• Home
  • Raw
  • Download

Lines Matching refs:parse

802         macro_rules! parse {  in test_parsed_to_naive_date()  macro
811 assert_eq!(parse!(), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
812 assert_eq!(parse!(year: 1984), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
813 assert_eq!(parse!(year: 1984, month: 1), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
814 assert_eq!(parse!(year: 1984, month: 1, day: 2), ymd(1984, 1, 2)); in test_parsed_to_naive_date()
815 assert_eq!(parse!(year: 1984, day: 2), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
816 assert_eq!(parse!(year_div_100: 19), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
817 assert_eq!(parse!(year_div_100: 19, year_mod_100: 84), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
818 assert_eq!(parse!(year_div_100: 19, year_mod_100: 84, month: 1), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
819 assert_eq!(parse!(year_div_100: 19, year_mod_100: 84, month: 1, day: 2), ymd(1984, 1, 2)); in test_parsed_to_naive_date()
820 assert_eq!(parse!(year_div_100: 19, year_mod_100: 84, day: 2), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
821 assert_eq!(parse!(year_div_100: 19, month: 1, day: 2), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
822 assert_eq!(parse!(year_mod_100: 70, month: 1, day: 2), ymd(1970, 1, 2)); in test_parsed_to_naive_date()
823 assert_eq!(parse!(year_mod_100: 69, month: 1, day: 2), ymd(2069, 1, 2)); in test_parsed_to_naive_date()
826 assert_eq!(parse!(year_div_100: 19, year_mod_100: 84, month: 2, day: 29), ymd(1984, 2, 29)); in test_parsed_to_naive_date()
828 parse!(year_div_100: 19, year_mod_100: 83, month: 2, day: 29), in test_parsed_to_naive_date()
832 parse!(year_div_100: 19, year_mod_100: 83, month: 13, day: 1), in test_parsed_to_naive_date()
836 parse!(year_div_100: 19, year_mod_100: 83, month: 12, day: 31), in test_parsed_to_naive_date()
840 parse!(year_div_100: 19, year_mod_100: 83, month: 12, day: 32), in test_parsed_to_naive_date()
844 parse!(year_div_100: 19, year_mod_100: 83, month: 12, day: 0), in test_parsed_to_naive_date()
848 parse!(year_div_100: 19, year_mod_100: 100, month: 1, day: 1), in test_parsed_to_naive_date()
851 assert_eq!(parse!(year_div_100: 19, year_mod_100: -1, month: 1, day: 1), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
852 assert_eq!(parse!(year_div_100: 0, year_mod_100: 0, month: 1, day: 1), ymd(0, 1, 1)); in test_parsed_to_naive_date()
853 assert_eq!(parse!(year_div_100: -1, year_mod_100: 42, month: 1, day: 1), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
856 parse!(year_div_100: max_year / 100, in test_parsed_to_naive_date()
861 parse!(year_div_100: (max_year + 1) / 100, in test_parsed_to_naive_date()
867 assert_eq!(parse!(year: 1984, year_div_100: 19, month: 1, day: 1), ymd(1984, 1, 1)); in test_parsed_to_naive_date()
868 assert_eq!(parse!(year: 1984, year_div_100: 20, month: 1, day: 1), Err(IMPOSSIBLE)); in test_parsed_to_naive_date()
869 assert_eq!(parse!(year: 1984, year_mod_100: 84, month: 1, day: 1), ymd(1984, 1, 1)); in test_parsed_to_naive_date()
870 assert_eq!(parse!(year: 1984, year_mod_100: 83, month: 1, day: 1), Err(IMPOSSIBLE)); in test_parsed_to_naive_date()
872 parse!(year: 1984, year_div_100: 19, year_mod_100: 84, month: 1, day: 1), in test_parsed_to_naive_date()
876 parse!(year: 1984, year_div_100: 18, year_mod_100: 94, month: 1, day: 1), in test_parsed_to_naive_date()
880 parse!(year: 1984, year_div_100: 18, year_mod_100: 184, month: 1, day: 1), in test_parsed_to_naive_date()
884 parse!(year: -1, year_div_100: 0, year_mod_100: -1, month: 1, day: 1), in test_parsed_to_naive_date()
888 parse!(year: -1, year_div_100: -1, year_mod_100: 99, month: 1, day: 1), in test_parsed_to_naive_date()
891 assert_eq!(parse!(year: -1, year_div_100: 0, month: 1, day: 1), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
892 assert_eq!(parse!(year: -1, year_mod_100: 99, month: 1, day: 1), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
895 assert_eq!(parse!(year: 2000, week_from_mon: 0), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
896 assert_eq!(parse!(year: 2000, week_from_sun: 0), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
897 assert_eq!(parse!(year: 2000, weekday: Sun), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
898 assert_eq!(parse!(year: 2000, week_from_mon: 0, weekday: Fri), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
899 assert_eq!(parse!(year: 2000, week_from_sun: 0, weekday: Fri), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
900 assert_eq!(parse!(year: 2000, week_from_mon: 0, weekday: Sat), ymd(2000, 1, 1)); in test_parsed_to_naive_date()
901 assert_eq!(parse!(year: 2000, week_from_sun: 0, weekday: Sat), ymd(2000, 1, 1)); in test_parsed_to_naive_date()
902 assert_eq!(parse!(year: 2000, week_from_mon: 0, weekday: Sun), ymd(2000, 1, 2)); in test_parsed_to_naive_date()
903 assert_eq!(parse!(year: 2000, week_from_sun: 1, weekday: Sun), ymd(2000, 1, 2)); in test_parsed_to_naive_date()
904 assert_eq!(parse!(year: 2000, week_from_mon: 1, weekday: Mon), ymd(2000, 1, 3)); in test_parsed_to_naive_date()
905 assert_eq!(parse!(year: 2000, week_from_sun: 1, weekday: Mon), ymd(2000, 1, 3)); in test_parsed_to_naive_date()
906 assert_eq!(parse!(year: 2000, week_from_mon: 1, weekday: Sat), ymd(2000, 1, 8)); in test_parsed_to_naive_date()
907 assert_eq!(parse!(year: 2000, week_from_sun: 1, weekday: Sat), ymd(2000, 1, 8)); in test_parsed_to_naive_date()
908 assert_eq!(parse!(year: 2000, week_from_mon: 1, weekday: Sun), ymd(2000, 1, 9)); in test_parsed_to_naive_date()
909 assert_eq!(parse!(year: 2000, week_from_sun: 2, weekday: Sun), ymd(2000, 1, 9)); in test_parsed_to_naive_date()
910 assert_eq!(parse!(year: 2000, week_from_mon: 2, weekday: Mon), ymd(2000, 1, 10)); in test_parsed_to_naive_date()
911 assert_eq!(parse!(year: 2000, week_from_sun: 52, weekday: Sat), ymd(2000, 12, 30)); in test_parsed_to_naive_date()
912 assert_eq!(parse!(year: 2000, week_from_sun: 53, weekday: Sun), ymd(2000, 12, 31)); in test_parsed_to_naive_date()
913 assert_eq!(parse!(year: 2000, week_from_sun: 53, weekday: Mon), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
914 assert_eq!(parse!(year: 2000, week_from_sun: 0xffffffff, weekday: Mon), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
915 assert_eq!(parse!(year: 2006, week_from_sun: 0, weekday: Sat), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
916 assert_eq!(parse!(year: 2006, week_from_sun: 1, weekday: Sun), ymd(2006, 1, 1)); in test_parsed_to_naive_date()
920 parse!(year: 2000, week_from_mon: 1, week_from_sun: 1, weekday: Sat), in test_parsed_to_naive_date()
924 parse!(year: 2000, week_from_mon: 1, week_from_sun: 2, weekday: Sun), in test_parsed_to_naive_date()
928 parse!(year: 2000, week_from_mon: 1, week_from_sun: 1, weekday: Sun), in test_parsed_to_naive_date()
932 parse!(year: 2000, week_from_mon: 2, week_from_sun: 2, weekday: Sun), in test_parsed_to_naive_date()
937 assert_eq!(parse!(isoyear: 2004, isoweek: 53), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
938 assert_eq!(parse!(isoyear: 2004, isoweek: 53, weekday: Fri), ymd(2004, 12, 31)); in test_parsed_to_naive_date()
939 assert_eq!(parse!(isoyear: 2004, isoweek: 53, weekday: Sat), ymd(2005, 1, 1)); in test_parsed_to_naive_date()
940 assert_eq!(parse!(isoyear: 2004, isoweek: 0xffffffff, weekday: Sat), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
941 assert_eq!(parse!(isoyear: 2005, isoweek: 0, weekday: Thu), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
942 assert_eq!(parse!(isoyear: 2005, isoweek: 5, weekday: Thu), ymd(2005, 2, 3)); in test_parsed_to_naive_date()
943 assert_eq!(parse!(isoyear: 2005, weekday: Thu), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
946 assert_eq!(parse!(ordinal: 123), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
947 assert_eq!(parse!(year: 2000, ordinal: 0), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
948 assert_eq!(parse!(year: 2000, ordinal: 1), ymd(2000, 1, 1)); in test_parsed_to_naive_date()
949 assert_eq!(parse!(year: 2000, ordinal: 60), ymd(2000, 2, 29)); in test_parsed_to_naive_date()
950 assert_eq!(parse!(year: 2000, ordinal: 61), ymd(2000, 3, 1)); in test_parsed_to_naive_date()
951 assert_eq!(parse!(year: 2000, ordinal: 366), ymd(2000, 12, 31)); in test_parsed_to_naive_date()
952 assert_eq!(parse!(year: 2000, ordinal: 367), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
953 assert_eq!(parse!(year: 2000, ordinal: 0xffffffff), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
954 assert_eq!(parse!(year: 2100, ordinal: 0), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
955 assert_eq!(parse!(year: 2100, ordinal: 1), ymd(2100, 1, 1)); in test_parsed_to_naive_date()
956 assert_eq!(parse!(year: 2100, ordinal: 59), ymd(2100, 2, 28)); in test_parsed_to_naive_date()
957 assert_eq!(parse!(year: 2100, ordinal: 60), ymd(2100, 3, 1)); in test_parsed_to_naive_date()
958 assert_eq!(parse!(year: 2100, ordinal: 365), ymd(2100, 12, 31)); in test_parsed_to_naive_date()
959 assert_eq!(parse!(year: 2100, ordinal: 366), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
960 assert_eq!(parse!(year: 2100, ordinal: 0xffffffff), Err(OUT_OF_RANGE)); in test_parsed_to_naive_date()
964 parse!(year: 2014, month: 12, day: 31, ordinal: 365, isoyear: 2015, isoweek: 1, in test_parsed_to_naive_date()
969 parse!(year: 2014, month: 12, ordinal: 365, isoyear: 2015, isoweek: 1, in test_parsed_to_naive_date()
974 parse!(year: 2014, month: 12, day: 31, ordinal: 365, isoyear: 2014, isoweek: 53, in test_parsed_to_naive_date()
979 parse!(year: 2012, isoyear: 2015, isoweek: 1, in test_parsed_to_naive_date()
983 assert_eq!(parse!(year_div_100: 20, isoyear_mod_100: 15, ordinal: 366), Err(NOT_ENOUGH)); in test_parsed_to_naive_date()
989 macro_rules! parse { in test_parsed_to_naive_time() macro
999 assert_eq!(parse!(), Err(NOT_ENOUGH)); in test_parsed_to_naive_time()
1000 assert_eq!(parse!(hour_div_12: 0), Err(NOT_ENOUGH)); in test_parsed_to_naive_time()
1001 assert_eq!(parse!(hour_div_12: 0, hour_mod_12: 1), Err(NOT_ENOUGH)); in test_parsed_to_naive_time()
1002 assert_eq!(parse!(hour_div_12: 0, hour_mod_12: 1, minute: 23), hms(1, 23, 0)); in test_parsed_to_naive_time()
1003 assert_eq!(parse!(hour_div_12: 0, hour_mod_12: 1, minute: 23, second: 45), hms(1, 23, 45)); in test_parsed_to_naive_time()
1005 parse!(hour_div_12: 0, hour_mod_12: 1, minute: 23, second: 45, in test_parsed_to_naive_time()
1009 assert_eq!(parse!(hour_div_12: 1, hour_mod_12: 11, minute: 45, second: 6), hms(23, 45, 6)); in test_parsed_to_naive_time()
1010 assert_eq!(parse!(hour_mod_12: 1, minute: 23), Err(NOT_ENOUGH)); in test_parsed_to_naive_time()
1012 parse!(hour_div_12: 0, hour_mod_12: 1, minute: 23, nanosecond: 456_789_012), in test_parsed_to_naive_time()
1017 assert_eq!(parse!(hour_div_12: 2, hour_mod_12: 0, minute: 0), Err(OUT_OF_RANGE)); in test_parsed_to_naive_time()
1018 assert_eq!(parse!(hour_div_12: 1, hour_mod_12: 12, minute: 0), Err(OUT_OF_RANGE)); in test_parsed_to_naive_time()
1019 assert_eq!(parse!(hour_div_12: 0, hour_mod_12: 1, minute: 60), Err(OUT_OF_RANGE)); in test_parsed_to_naive_time()
1021 parse!(hour_div_12: 0, hour_mod_12: 1, minute: 23, second: 61), in test_parsed_to_naive_time()
1025 parse!(hour_div_12: 0, hour_mod_12: 1, minute: 23, second: 34, in test_parsed_to_naive_time()
1032 parse!(hour_div_12: 0, hour_mod_12: 1, minute: 23, second: 60), in test_parsed_to_naive_time()
1036 parse!(hour_div_12: 0, hour_mod_12: 1, minute: 23, second: 60, in test_parsed_to_naive_time()
1044 macro_rules! parse { in test_parsed_to_naive_datetime_with_offset() macro
1048 ($($k:ident: $v:expr),*) => (parse!(offset = 0; $($k: $v),*)) in test_parsed_to_naive_datetime_with_offset()
1056 assert_eq!(parse!(), Err(NOT_ENOUGH)); in test_parsed_to_naive_datetime_with_offset()
1058 parse!(year: 2015, month: 1, day: 30, in test_parsed_to_naive_datetime_with_offset()
1063 parse!(year: 1997, month: 1, day: 30, in test_parsed_to_naive_datetime_with_offset()
1068 parse!(year: 2012, ordinal: 34, hour_div_12: 0, hour_mod_12: 5, in test_parsed_to_naive_datetime_with_offset()
1072 assert_eq!(parse!(timestamp: 0), ymdhms(1970, 1, 1, 0, 0, 0)); in test_parsed_to_naive_datetime_with_offset()
1073 assert_eq!(parse!(timestamp: 1, nanosecond: 0), ymdhms(1970, 1, 1, 0, 0, 1)); in test_parsed_to_naive_datetime_with_offset()
1074 assert_eq!(parse!(timestamp: 1, nanosecond: 1), ymdhmsn(1970, 1, 1, 0, 0, 1, 1)); in test_parsed_to_naive_datetime_with_offset()
1075 assert_eq!(parse!(timestamp: 1_420_000_000), ymdhms(2014, 12, 31, 4, 26, 40)); in test_parsed_to_naive_datetime_with_offset()
1076 assert_eq!(parse!(timestamp: -0x1_0000_0000), ymdhms(1833, 11, 24, 17, 31, 44)); in test_parsed_to_naive_datetime_with_offset()
1080 parse!(year: 2014, year_div_100: 20, year_mod_100: 14, month: 12, day: 31, in test_parsed_to_naive_datetime_with_offset()
1088 parse!(year: 2014, year_div_100: 20, year_mod_100: 14, month: 12, day: 31, in test_parsed_to_naive_datetime_with_offset()
1096 parse!(offset = 32400; in test_parsed_to_naive_datetime_with_offset()
1113 parse!(timestamp: min_days_from_year_1970.num_seconds()), in test_parsed_to_naive_datetime_with_offset()
1117 parse!(timestamp: year_0_from_year_1970.num_seconds()), in test_parsed_to_naive_datetime_with_offset()
1121 parse!(timestamp: max_days_from_year_1970.num_seconds() + 86399), in test_parsed_to_naive_datetime_with_offset()
1126 assert_eq!(parse!(second: 59, timestamp: 1_341_100_798), Err(IMPOSSIBLE)); in test_parsed_to_naive_datetime_with_offset()
1127 assert_eq!(parse!(second: 59, timestamp: 1_341_100_799), ymdhms(2012, 6, 30, 23, 59, 59)); in test_parsed_to_naive_datetime_with_offset()
1128 assert_eq!(parse!(second: 59, timestamp: 1_341_100_800), Err(IMPOSSIBLE)); in test_parsed_to_naive_datetime_with_offset()
1130 parse!(second: 60, timestamp: 1_341_100_799), in test_parsed_to_naive_datetime_with_offset()
1134 parse!(second: 60, timestamp: 1_341_100_800), in test_parsed_to_naive_datetime_with_offset()
1137 assert_eq!(parse!(second: 0, timestamp: 1_341_100_800), ymdhms(2012, 7, 1, 0, 0, 0)); in test_parsed_to_naive_datetime_with_offset()
1138 assert_eq!(parse!(second: 1, timestamp: 1_341_100_800), Err(IMPOSSIBLE)); in test_parsed_to_naive_datetime_with_offset()
1139 assert_eq!(parse!(second: 60, timestamp: 1_341_100_801), Err(IMPOSSIBLE)); in test_parsed_to_naive_datetime_with_offset()
1144 parse!(year: 2012, ordinal: 182, hour_div_12: 1, hour_mod_12: 11, in test_parsed_to_naive_datetime_with_offset()
1149 parse!(year: 2012, ordinal: 182, hour_div_12: 1, hour_mod_12: 11, in test_parsed_to_naive_datetime_with_offset()
1154 parse!(year: 2012, ordinal: 182, hour_div_12: 1, hour_mod_12: 11, in test_parsed_to_naive_datetime_with_offset()
1159 parse!(year: 2012, ordinal: 182, hour_div_12: 1, hour_mod_12: 11, in test_parsed_to_naive_datetime_with_offset()
1164 parse!(year: 2012, ordinal: 182, hour_div_12: 1, hour_mod_12: 11, in test_parsed_to_naive_datetime_with_offset()
1169 parse!(year: 2012, ordinal: 183, hour_div_12: 0, hour_mod_12: 0, in test_parsed_to_naive_datetime_with_offset()
1174 parse!(year: 2012, ordinal: 183, hour_div_12: 0, hour_mod_12: 0, in test_parsed_to_naive_datetime_with_offset()
1179 parse!(year: 2012, ordinal: 182, hour_div_12: 1, hour_mod_12: 11, in test_parsed_to_naive_datetime_with_offset()
1186 parse!(year: 2015, month: 1, day: 20, weekday: Tue, in test_parsed_to_naive_datetime_with_offset()
1194 macro_rules! parse { in test_parsed_to_datetime() macro
1204 assert_eq!(parse!(offset: 0), Err(NOT_ENOUGH)); in test_parsed_to_datetime()
1206 parse!(year: 2014, ordinal: 365, hour_div_12: 0, hour_mod_12: 4, in test_parsed_to_datetime()
1211 parse!(year: 2014, ordinal: 365, hour_div_12: 0, hour_mod_12: 4, in test_parsed_to_datetime()
1216 parse!(year: 2014, ordinal: 365, hour_div_12: 1, hour_mod_12: 1, in test_parsed_to_datetime()
1221 parse!(year: 2014, ordinal: 365, hour_div_12: 0, hour_mod_12: 1, in test_parsed_to_datetime()
1226 parse!(year: 2015, ordinal: 1, hour_div_12: 0, hour_mod_12: 4, in test_parsed_to_datetime()
1234 macro_rules! parse { in test_parsed_to_datetime_with_timezone() macro
1242 parse!(Utc; in test_parsed_to_datetime_with_timezone()
1248 parse!(Utc; in test_parsed_to_datetime_with_timezone()
1254 parse!(FixedOffset::east(32400); in test_parsed_to_datetime_with_timezone()
1260 parse!(FixedOffset::east(32400); in test_parsed_to_datetime_with_timezone()
1268 parse!(Utc; timestamp: 1_420_000_000, offset: 0), in test_parsed_to_datetime_with_timezone()
1271 assert_eq!(parse!(Utc; timestamp: 1_420_000_000, offset: 32400), Err(IMPOSSIBLE)); in test_parsed_to_datetime_with_timezone()
1273 parse!(FixedOffset::east(32400); timestamp: 1_420_000_000, offset: 0), in test_parsed_to_datetime_with_timezone()
1277 parse!(FixedOffset::east(32400); timestamp: 1_420_000_000, offset: 32400), in test_parsed_to_datetime_with_timezone()