Skip to content

Commit

Permalink
parse tests around nanosecond parsing bare '.'
Browse files Browse the repository at this point in the history
  • Loading branch information
jtmoon79 committed May 28, 2023
1 parent 2149047 commit c2ff8f1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/format/parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,7 @@ fn test_parse() {
check!("4x", [internal_fix!(Nanosecond3NoDot)]; TOO_SHORT);
check!(" 4", [internal_fix!(Nanosecond3NoDot)]; INVALID);
check!(".421", [internal_fix!(Nanosecond3NoDot)]; INVALID);
check!(".", [internal_fix!(Nanosecond3NoDot)]; TOO_SHORT);

check!("", [internal_fix!(Nanosecond6NoDot)]; TOO_SHORT);
check!("0", [internal_fix!(Nanosecond6NoDot)]; TOO_SHORT);
Expand All @@ -927,6 +928,7 @@ fn test_parse() {
check!("4x", [internal_fix!(Nanosecond6NoDot)]; TOO_SHORT);
check!(" 4", [internal_fix!(Nanosecond6NoDot)]; INVALID);
check!(".42100", [internal_fix!(Nanosecond6NoDot)]; INVALID);
check!(".", [internal_fix!(Nanosecond6NoDot)]; TOO_SHORT);

check!("", [internal_fix!(Nanosecond9NoDot)]; TOO_SHORT);
check!("42195", [internal_fix!(Nanosecond9NoDot)]; TOO_SHORT);
Expand All @@ -939,6 +941,7 @@ fn test_parse() {
check!("00000000x", [internal_fix!(Nanosecond9NoDot)]; INVALID);
check!(" 4", [internal_fix!(Nanosecond9NoDot)]; INVALID);
check!(".42100000", [internal_fix!(Nanosecond9NoDot)]; INVALID);
check!(".", [internal_fix!(Nanosecond9NoDot)]; TOO_SHORT);

// fixed: timezone offsets

Expand Down

0 comments on commit c2ff8f1

Please sign in to comment.