Lines Matching refs:check
514 macro_rules! check { in test_parse() macro
526 check!("", []; ); in test_parse()
527 check!(" ", []; TOO_LONG); in test_parse()
528 check!("a", []; TOO_LONG); in test_parse()
531 check!("", [sp!("")]; ); in test_parse()
532 check!(" ", [sp!("")]; ); in test_parse()
533 check!("\t", [sp!("")]; ); in test_parse()
534 check!(" \n\r \n", [sp!("")]; ); in test_parse()
535 check!("a", [sp!("")]; TOO_LONG); in test_parse()
538 check!("", [lit!("a")]; TOO_SHORT); in test_parse()
539 check!(" ", [lit!("a")]; INVALID); in test_parse()
540 check!("a", [lit!("a")]; ); in test_parse()
541 check!("aa", [lit!("a")]; TOO_LONG); in test_parse()
542 check!("A", [lit!("a")]; INVALID); in test_parse()
543 check!("xy", [lit!("xy")]; ); in test_parse()
544 check!("xy", [lit!("x"), lit!("y")]; ); in test_parse()
545 check!("x y", [lit!("x"), lit!("y")]; INVALID); in test_parse()
546 check!("xy", [lit!("x"), sp!(""), lit!("y")]; ); in test_parse()
547 check!("x y", [lit!("x"), sp!(""), lit!("y")]; ); in test_parse()
550 check!("1987", [num!(Year)]; year: 1987); in test_parse()
551 check!("1987 ", [num!(Year)]; TOO_LONG); in test_parse()
552 check!("0x12", [num!(Year)]; TOO_LONG); // `0` is parsed in test_parse()
553 check!("x123", [num!(Year)]; INVALID); in test_parse()
554 check!("2015", [num!(Year)]; year: 2015); in test_parse()
555 check!("0000", [num!(Year)]; year: 0); in test_parse()
556 check!("9999", [num!(Year)]; year: 9999); in test_parse()
557 check!(" \t987", [num!(Year)]; year: 987); in test_parse()
558 check!("5", [num!(Year)]; year: 5); in test_parse()
559 check!("5\0", [num!(Year)]; TOO_LONG); in test_parse()
560 check!("\05", [num!(Year)]; INVALID); in test_parse()
561 check!("", [num!(Year)]; TOO_SHORT); in test_parse()
562 check!("12345", [num!(Year), lit!("5")]; year: 1234); in test_parse()
563 check!("12345", [nums!(Year), lit!("5")]; year: 1234); in test_parse()
564 check!("12345", [num0!(Year), lit!("5")]; year: 1234); in test_parse()
565 check!("12341234", [num!(Year), num!(Year)]; year: 1234); in test_parse()
566 check!("1234 1234", [num!(Year), num!(Year)]; year: 1234); in test_parse()
567 check!("1234 1235", [num!(Year), num!(Year)]; IMPOSSIBLE); in test_parse()
568 check!("1234 1234", [num!(Year), lit!("x"), num!(Year)]; INVALID); in test_parse()
569 check!("1234x1234", [num!(Year), lit!("x"), num!(Year)]; year: 1234); in test_parse()
570 check!("1234xx1234", [num!(Year), lit!("x"), num!(Year)]; INVALID); in test_parse()
571 check!("1234 x 1234", [num!(Year), lit!("x"), num!(Year)]; INVALID); in test_parse()
574 check!("-42", [num!(Year)]; year: -42); in test_parse()
575 check!("+42", [num!(Year)]; year: 42); in test_parse()
576 check!("-0042", [num!(Year)]; year: -42); in test_parse()
577 check!("+0042", [num!(Year)]; year: 42); in test_parse()
578 check!("-42195", [num!(Year)]; year: -42195); in test_parse()
579 check!("+42195", [num!(Year)]; year: 42195); in test_parse()
580 check!(" -42195", [num!(Year)]; year: -42195); in test_parse()
581 check!(" +42195", [num!(Year)]; year: 42195); in test_parse()
582 check!(" - 42", [num!(Year)]; INVALID); in test_parse()
583 check!(" + 42", [num!(Year)]; INVALID); in test_parse()
584 check!("-", [num!(Year)]; TOO_SHORT); in test_parse()
585 check!("+", [num!(Year)]; TOO_SHORT); in test_parse()
588 check!("345", [num!(Ordinal)]; ordinal: 345); in test_parse()
589 check!("+345", [num!(Ordinal)]; INVALID); in test_parse()
590 check!("-345", [num!(Ordinal)]; INVALID); in test_parse()
591 check!(" 345", [num!(Ordinal)]; ordinal: 345); in test_parse()
592 check!(" +345", [num!(Ordinal)]; INVALID); in test_parse()
593 check!(" -345", [num!(Ordinal)]; INVALID); in test_parse()
596 check!("1234 5678", in test_parse()
599 check!("12 34 56 78", in test_parse()
602 check!("1 2 3 4 5 6", in test_parse()
606 check!("7 89 01", in test_parse()
609 check!("23 45 6 78901234 567890123", in test_parse()
615 check!("apr", [fix!(ShortMonthName)]; month: 4); in test_parse()
616 check!("Apr", [fix!(ShortMonthName)]; month: 4); in test_parse()
617 check!("APR", [fix!(ShortMonthName)]; month: 4); in test_parse()
618 check!("ApR", [fix!(ShortMonthName)]; month: 4); in test_parse()
619 check!("April", [fix!(ShortMonthName)]; TOO_LONG); // `Apr` is parsed in test_parse()
620 check!("A", [fix!(ShortMonthName)]; TOO_SHORT); in test_parse()
621 check!("Sol", [fix!(ShortMonthName)]; INVALID); in test_parse()
622 check!("Apr", [fix!(LongMonthName)]; month: 4); in test_parse()
623 check!("Apri", [fix!(LongMonthName)]; TOO_LONG); // `Apr` is parsed in test_parse()
624 check!("April", [fix!(LongMonthName)]; month: 4); in test_parse()
625 check!("Aprill", [fix!(LongMonthName)]; TOO_LONG); in test_parse()
626 check!("Aprill", [fix!(LongMonthName), lit!("l")]; month: 4); in test_parse()
627 check!("Aprl", [fix!(LongMonthName), lit!("l")]; month: 4); in test_parse()
628 check!("April", [fix!(LongMonthName), lit!("il")]; TOO_SHORT); // do not backtrack in test_parse()
629 check!("thu", [fix!(ShortWeekdayName)]; weekday: Weekday::Thu); in test_parse()
630 check!("Thu", [fix!(ShortWeekdayName)]; weekday: Weekday::Thu); in test_parse()
631 check!("THU", [fix!(ShortWeekdayName)]; weekday: Weekday::Thu); in test_parse()
632 check!("tHu", [fix!(ShortWeekdayName)]; weekday: Weekday::Thu); in test_parse()
633 check!("Thursday", [fix!(ShortWeekdayName)]; TOO_LONG); // `Thu` is parsed in test_parse()
634 check!("T", [fix!(ShortWeekdayName)]; TOO_SHORT); in test_parse()
635 check!("The", [fix!(ShortWeekdayName)]; INVALID); in test_parse()
636 check!("Nop", [fix!(ShortWeekdayName)]; INVALID); in test_parse()
637 check!("Thu", [fix!(LongWeekdayName)]; weekday: Weekday::Thu); in test_parse()
638 check!("Thur", [fix!(LongWeekdayName)]; TOO_LONG); // `Thu` is parsed in test_parse()
639 check!("Thurs", [fix!(LongWeekdayName)]; TOO_LONG); // ditto in test_parse()
640 check!("Thursday", [fix!(LongWeekdayName)]; weekday: Weekday::Thu); in test_parse()
641 check!("Thursdays", [fix!(LongWeekdayName)]; TOO_LONG); in test_parse()
642 check!("Thursdays", [fix!(LongWeekdayName), lit!("s")]; weekday: Weekday::Thu); in test_parse()
643 check!("Thus", [fix!(LongWeekdayName), lit!("s")]; weekday: Weekday::Thu); in test_parse()
644 check!("Thursday", [fix!(LongWeekdayName), lit!("rsday")]; TOO_SHORT); // do not backtrack in test_parse()
647 check!("am", [fix!(LowerAmPm)]; hour_div_12: 0); in test_parse()
648 check!("pm", [fix!(LowerAmPm)]; hour_div_12: 1); in test_parse()
649 check!("AM", [fix!(LowerAmPm)]; hour_div_12: 0); in test_parse()
650 check!("PM", [fix!(LowerAmPm)]; hour_div_12: 1); in test_parse()
651 check!("am", [fix!(UpperAmPm)]; hour_div_12: 0); in test_parse()
652 check!("pm", [fix!(UpperAmPm)]; hour_div_12: 1); in test_parse()
653 check!("AM", [fix!(UpperAmPm)]; hour_div_12: 0); in test_parse()
654 check!("PM", [fix!(UpperAmPm)]; hour_div_12: 1); in test_parse()
655 check!("Am", [fix!(LowerAmPm)]; hour_div_12: 0); in test_parse()
656 check!(" Am", [fix!(LowerAmPm)]; INVALID); in test_parse()
657 check!("ame", [fix!(LowerAmPm)]; TOO_LONG); // `am` is parsed in test_parse()
658 check!("a", [fix!(LowerAmPm)]; TOO_SHORT); in test_parse()
659 check!("p", [fix!(LowerAmPm)]; TOO_SHORT); in test_parse()
660 check!("x", [fix!(LowerAmPm)]; TOO_SHORT); in test_parse()
661 check!("xx", [fix!(LowerAmPm)]; INVALID); in test_parse()
662 check!("", [fix!(LowerAmPm)]; TOO_SHORT); in test_parse()
665 check!("", [fix!(Nanosecond)]; ); // no field set, but not an error in test_parse()
666 check!("4", [fix!(Nanosecond)]; TOO_LONG); // never consumes `4` in test_parse()
667 check!("4", [fix!(Nanosecond), num!(Second)]; second: 4); in test_parse()
668 check!(".0", [fix!(Nanosecond)]; nanosecond: 0); in test_parse()
669 check!(".4", [fix!(Nanosecond)]; nanosecond: 400_000_000); in test_parse()
670 check!(".42", [fix!(Nanosecond)]; nanosecond: 420_000_000); in test_parse()
671 check!(".421", [fix!(Nanosecond)]; nanosecond: 421_000_000); in test_parse()
672 check!(".42195", [fix!(Nanosecond)]; nanosecond: 421_950_000); in test_parse()
673 check!(".421950803", [fix!(Nanosecond)]; nanosecond: 421_950_803); in test_parse()
674 check!(".421950803547", [fix!(Nanosecond)]; nanosecond: 421_950_803); in test_parse()
675 check!(".000000003547", [fix!(Nanosecond)]; nanosecond: 3); in test_parse()
676 check!(".000000000547", [fix!(Nanosecond)]; nanosecond: 0); in test_parse()
677 check!(".", [fix!(Nanosecond)]; TOO_SHORT); in test_parse()
678 check!(".4x", [fix!(Nanosecond)]; TOO_LONG); in test_parse()
679 check!(". 4", [fix!(Nanosecond)]; INVALID); in test_parse()
680 check!(" .4", [fix!(Nanosecond)]; TOO_LONG); // no automatic trimming in test_parse()
683 check!("", [internal_fix!(Nanosecond3NoDot)]; TOO_SHORT); in test_parse()
684 check!("0", [internal_fix!(Nanosecond3NoDot)]; TOO_SHORT); in test_parse()
685 check!("4", [internal_fix!(Nanosecond3NoDot)]; TOO_SHORT); in test_parse()
686 check!("42", [internal_fix!(Nanosecond3NoDot)]; TOO_SHORT); in test_parse()
687 check!("421", [internal_fix!(Nanosecond3NoDot)]; nanosecond: 421_000_000); in test_parse()
688 …check!("42143", [internal_fix!(Nanosecond3NoDot), num!(Second)]; nanosecond: 421_000_000, s… in test_parse()
689 check!("42195", [internal_fix!(Nanosecond3NoDot)]; TOO_LONG); in test_parse()
690 check!("4x", [internal_fix!(Nanosecond3NoDot)]; TOO_SHORT); in test_parse()
691 check!(" 4", [internal_fix!(Nanosecond3NoDot)]; INVALID); in test_parse()
692 check!(".421", [internal_fix!(Nanosecond3NoDot)]; INVALID); in test_parse()
694 check!("", [internal_fix!(Nanosecond6NoDot)]; TOO_SHORT); in test_parse()
695 check!("0", [internal_fix!(Nanosecond6NoDot)]; TOO_SHORT); in test_parse()
696 check!("42195", [internal_fix!(Nanosecond6NoDot)]; TOO_SHORT); in test_parse()
697 check!("421950", [internal_fix!(Nanosecond6NoDot)]; nanosecond: 421_950_000); in test_parse()
698 check!("000003", [internal_fix!(Nanosecond6NoDot)]; nanosecond: 3000); in test_parse()
699 check!("000000", [internal_fix!(Nanosecond6NoDot)]; nanosecond: 0); in test_parse()
700 check!("4x", [internal_fix!(Nanosecond6NoDot)]; TOO_SHORT); in test_parse()
701 check!(" 4", [internal_fix!(Nanosecond6NoDot)]; INVALID); in test_parse()
702 check!(".42100", [internal_fix!(Nanosecond6NoDot)]; INVALID); in test_parse()
704 check!("", [internal_fix!(Nanosecond9NoDot)]; TOO_SHORT); in test_parse()
705 check!("42195", [internal_fix!(Nanosecond9NoDot)]; TOO_SHORT); in test_parse()
706 check!("421950803", [internal_fix!(Nanosecond9NoDot)]; nanosecond: 421_950_803); in test_parse()
707 check!("000000003", [internal_fix!(Nanosecond9NoDot)]; nanosecond: 3); in test_parse()
708 …check!("42195080354", [internal_fix!(Nanosecond9NoDot), num!(Second)]; nanosecond: 421_950_803, s… in test_parse()
709 check!("421950803547", [internal_fix!(Nanosecond9NoDot)]; TOO_LONG); in test_parse()
710 check!("000000000", [internal_fix!(Nanosecond9NoDot)]; nanosecond: 0); in test_parse()
711 check!("00000000x", [internal_fix!(Nanosecond9NoDot)]; INVALID); in test_parse()
712 check!(" 4", [internal_fix!(Nanosecond9NoDot)]; INVALID); in test_parse()
713 check!(".42100000", [internal_fix!(Nanosecond9NoDot)]; INVALID); in test_parse()
716 check!("+00:00", [fix!(TimezoneOffset)]; offset: 0); in test_parse()
717 check!("-00:00", [fix!(TimezoneOffset)]; offset: 0); in test_parse()
718 check!("+00:01", [fix!(TimezoneOffset)]; offset: 60); in test_parse()
719 check!("-00:01", [fix!(TimezoneOffset)]; offset: -60); in test_parse()
720 check!("+00:30", [fix!(TimezoneOffset)]; offset: 30 * 60); in test_parse()
721 check!("-00:30", [fix!(TimezoneOffset)]; offset: -30 * 60); in test_parse()
722 check!("+04:56", [fix!(TimezoneOffset)]; offset: 296 * 60); in test_parse()
723 check!("-04:56", [fix!(TimezoneOffset)]; offset: -296 * 60); in test_parse()
724 check!("+24:00", [fix!(TimezoneOffset)]; offset: 24 * 60 * 60); in test_parse()
725 check!("-24:00", [fix!(TimezoneOffset)]; offset: -24 * 60 * 60); in test_parse()
726 check!("+99:59", [fix!(TimezoneOffset)]; offset: (100 * 60 - 1) * 60); in test_parse()
727 check!("-99:59", [fix!(TimezoneOffset)]; offset: -(100 * 60 - 1) * 60); in test_parse()
728 check!("+00:59", [fix!(TimezoneOffset)]; offset: 59 * 60); in test_parse()
729 check!("+00:60", [fix!(TimezoneOffset)]; OUT_OF_RANGE); in test_parse()
730 check!("+00:99", [fix!(TimezoneOffset)]; OUT_OF_RANGE); in test_parse()
731 check!("#12:34", [fix!(TimezoneOffset)]; INVALID); in test_parse()
732 check!("12:34", [fix!(TimezoneOffset)]; INVALID); in test_parse()
733 check!("+12:34 ", [fix!(TimezoneOffset)]; TOO_LONG); in test_parse()
734 check!(" +12:34", [fix!(TimezoneOffset)]; offset: 754 * 60); in test_parse()
735 check!("\t -12:34", [fix!(TimezoneOffset)]; offset: -754 * 60); in test_parse()
736 check!("", [fix!(TimezoneOffset)]; TOO_SHORT); in test_parse()
737 check!("+", [fix!(TimezoneOffset)]; TOO_SHORT); in test_parse()
738 check!("+1", [fix!(TimezoneOffset)]; TOO_SHORT); in test_parse()
739 check!("+12", [fix!(TimezoneOffset)]; TOO_SHORT); in test_parse()
740 check!("+123", [fix!(TimezoneOffset)]; TOO_SHORT); in test_parse()
741 check!("+1234", [fix!(TimezoneOffset)]; offset: 754 * 60); in test_parse()
742 check!("+12345", [fix!(TimezoneOffset)]; TOO_LONG); in test_parse()
743 check!("+12345", [fix!(TimezoneOffset), num!(Day)]; offset: 754 * 60, day: 5); in test_parse()
744 check!("Z", [fix!(TimezoneOffset)]; INVALID); in test_parse()
745 check!("z", [fix!(TimezoneOffset)]; INVALID); in test_parse()
746 check!("Z", [fix!(TimezoneOffsetZ)]; offset: 0); in test_parse()
747 check!("z", [fix!(TimezoneOffsetZ)]; offset: 0); in test_parse()
748 check!("Y", [fix!(TimezoneOffsetZ)]; INVALID); in test_parse()
749 check!("Zulu", [fix!(TimezoneOffsetZ), lit!("ulu")]; offset: 0); in test_parse()
750 check!("zulu", [fix!(TimezoneOffsetZ), lit!("ulu")]; offset: 0); in test_parse()
751 check!("+1234ulu", [fix!(TimezoneOffsetZ), lit!("ulu")]; offset: 754 * 60); in test_parse()
752 check!("+12:34ulu", [fix!(TimezoneOffsetZ), lit!("ulu")]; offset: 754 * 60); in test_parse()
753 check!("Z", [internal_fix!(TimezoneOffsetPermissive)]; offset: 0); in test_parse()
754 check!("z", [internal_fix!(TimezoneOffsetPermissive)]; offset: 0); in test_parse()
755 check!("+12:00", [internal_fix!(TimezoneOffsetPermissive)]; offset: 12 * 60 * 60); in test_parse()
756 check!("+12", [internal_fix!(TimezoneOffsetPermissive)]; offset: 12 * 60 * 60); in test_parse()
757 check!("CEST 5", [fix!(TimezoneName), lit!(" "), num!(Day)]; day: 5); in test_parse()
760 check!("2015-02-04T14:37:05+09:00", in test_parse()
765 check!("20150204143705567", in test_parse()
770 check!("Mon, 10 Jun 2013 09:32:37 GMT", in test_parse()
776 check!("Sun Aug 02 13:39:15 CEST 2020", in test_parse()
782 check!("20060102150405", in test_parse()
785 check!("3:14PM", in test_parse()
788 check!("12345678901234.56789", in test_parse()
791 check!("12345678901234.56789", in test_parse()