Skip to content

Commit

Permalink
Add tests for augur curate format-dates
Browse files Browse the repository at this point in the history
Shows current behavior when the date field is empty or whitespace only.
  • Loading branch information
joverlee521 committed Jul 1, 2024
1 parent 25f4993 commit ea69f00
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/functional/curate/cram/format-dates/empty-date-field.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Setup

$ export AUGUR="${AUGUR:-$TESTDIR/../../../../../bin/augur}"

Test empty date value.
This currently has the unexpected behavior of returning the empty string.

$ echo '{"record": 1, "date": ""}' \
> | ${AUGUR} curate format-dates \
> --date-fields "date"
{"record": 1, "date": ""}

Test whitespace only date value.
This currently raises an error.

$ echo '{"record": 1, "date": " "}' \
> | ${AUGUR} curate format-dates \
> --date-fields "date"
ERROR: Unable to format date string ' ' in field 'date' of record 0.
[2]

0 comments on commit ea69f00

Please sign in to comment.