Skip to content

init test #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions t/constructor.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,37 @@ throws_ok { Date::Utility->new("2001-12-44") } qr/Invalid datetime format/,
throws_ok { Date::Utility->new("2001-12-31 23:59:61") } qr/Invalid datetime format/, 'not accepting 61 as a value for seconds';
throws_ok { Date::Utility->new('4-Jun-54') } qr/only supports two-digit years from 1970-2030/, 'No two digit years between 30 and 70';
throws_ok { Date::Utility->new('fake') } qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-2')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-22')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-222')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-2222')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-22222')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('20192')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019222')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922222')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922-')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922-2')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922-22')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922-222')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019- 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-2 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-22 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-222 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-2222 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019-22222 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('20192 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('2019222 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922222 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922-')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922-2 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922-22 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';
throws_ok { Date::Utility->new('201922-222 23:59:59')} qr/Invalid datetime format/, 'random string is not a date string';

# Passy stuff
new_ok('Date::Utility');
new_ok(
Expand Down