Skip to content

Commit c5608d9

Browse files
pombredanneferdnyc
andauthored
Add weird is_iso_date tests #14
These are non-valid ISO dates but we do not validate fully just a surface validation using a regex. This captures the weird cases we accept. Reference: #14 Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com> Co-authored-by: Frank Dana <ferdnyc@gmail.com>
1 parent 22f5e3e commit c5608d9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

tests/test_saneyaml.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,9 @@ def test_is_iso_date(self):
149149
assert not saneyaml.is_iso_date('1994-01-1')
150150
assert not saneyaml.is_iso_date('1994-1-1')
151151
assert not saneyaml.is_iso_date('193')
152+
# Hey, nothing's perfect
153+
assert saneyaml.is_iso_date('2003-02-29')
154+
assert saneyaml.is_iso_date('2004-01-35')
152155

153156

154157
safe_chars = re.compile(r'[\W_]', re.MULTILINE)

0 commit comments

Comments
 (0)