From 0e9b06482efea407a7a90630c9e62d9bec5e94f4 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 22 Nov 2007 22:44:51 +0100 Subject: [PATCH] Add tests to show new class of strings accepted by date -d. * tests/misc/date (rel-1day, rel-plus1): New tests for the recent change in gnulib's getdate.y. * NEWS: Mention the fix. --- ChangeLog | 7 +++++++ NEWS | 3 +++ tests/misc/date | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3d682f9107..1473f7ef39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2007-11-23 Jim Meyering + + Add tests to show new class of strings accepted by date -d. + * tests/misc/date (rel-1day, rel-plus1): New tests for the recent + change in gnulib's getdate.y. + * NEWS: Mention the fix. + 2007-11-22 Jim Meyering Quiet warnings about unused parameters. diff --git a/NEWS b/NEWS index a5936f896f..14fb3cd8ba 100644 --- a/NEWS +++ b/NEWS @@ -108,6 +108,9 @@ GNU coreutils NEWS -*- outline -*- cut now diagnoses the '-' in "cut -f -" as an invalid range, rather than interpreting it as the unlimited range, "1-". + date -d now accepts strings of the form e.g., 'YYYYMMDD +N days', + in addition to the usual 'YYYYMMDD N days'. + du -s now includes the size of any stat'able-but-inaccessible directory in the total size. diff --git a/tests/misc/date b/tests/misc/date index 7408ea2772..4a87e648ad 100755 --- a/tests/misc/date +++ b/tests/misc/date @@ -126,6 +126,11 @@ my @Tests = ['rel-3a', "-d '$d1 4 seconds ago' $fmt", {OUT=>"$d0 08:17:44"}], + # This has always worked, ... + ['rel-1day', "-d '20050101 1 day' +%F", {OUT=>"2005-01-02"}], + # ...but up to coreutils-6.9, this was rejected due to the "+". + ['rel-plus1', "-d '20050101 +1 day' +%F", {OUT=>"2005-01-02"}], + ['next-s', "-d '$d1 next second' '+%Y-%m-%d %T'", {OUT=>"$d0 $ts"}], ['next-m', "-d '$d1 next minute' '+%Y-%m-%d %T'", {OUT=>"$d0 $tm"}], ['next-h', "-d '$d1 next hour' '+%Y-%m-%d %T'", {OUT=>"$d0 $th"}], -- 2.47.2