diff options
Diffstat (limited to 'bin/date/tests')
-rw-r--r-- | bin/date/tests/Makefile | 2 | ||||
-rw-r--r-- | bin/date/tests/Makefile.depend | 1 | ||||
-rwxr-xr-x | bin/date/tests/format_string_test.sh | 18 |
3 files changed, 15 insertions, 6 deletions
diff --git a/bin/date/tests/Makefile b/bin/date/tests/Makefile index 64d86d23bee6..98625c4b1b34 100644 --- a/bin/date/tests/Makefile +++ b/bin/date/tests/Makefile @@ -1,5 +1,3 @@ -# $FreeBSD$ - ATF_TESTS_SH= format_string_test .include <bsd.test.mk> diff --git a/bin/date/tests/Makefile.depend b/bin/date/tests/Makefile.depend index f80275d86ab1..11aba52f82cf 100644 --- a/bin/date/tests/Makefile.depend +++ b/bin/date/tests/Makefile.depend @@ -1,4 +1,3 @@ -# $FreeBSD$ # Autogenerated - do NOT edit! DIRDEPS = \ diff --git a/bin/date/tests/format_string_test.sh b/bin/date/tests/format_string_test.sh index 7ae323b50adc..c2fe2111373f 100755 --- a/bin/date/tests/format_string_test.sh +++ b/bin/date/tests/format_string_test.sh @@ -3,7 +3,6 @@ # # Submitted by Edwin Groothuis <edwin@FreeBSD.org> # -# $FreeBSD$ # # @@ -31,6 +30,17 @@ check() date -r ${TEST2} +%${format_string} } +atf_test_case flag_r_file_test +flag_r_file_test_body() +{ + local file + + file="./testfile" + touch "$file" + atf_check -o "inline:$(stat -f '%9Fm' "$file")\n" \ + date -r "$file" +%s.%N +} + format_string_test() { local desc exp_output_1 exp_output_2 flag @@ -99,6 +109,8 @@ iso8601_${desc}_parity_body() { atf_init_test_cases() { + atf_add_test_case flag_r_file_test + format_string_test A A Saturday Monday format_string_test a a Sat Mon format_string_test B B February November @@ -119,6 +131,7 @@ atf_init_test_cases() format_string_test l l " 7" " 9" format_string_test M M 04 20 format_string_test m m 02 11 + format_string_test N N 000000000 000000000 format_string_test p p AM PM format_string_test R R 07:04 21:20 format_string_test r r "07:04:03 AM" "09:20:00 PM" @@ -144,6 +157,5 @@ atf_init_test_cases() iso8601_string_test hours hours "" "1970-02-07T07+00:00" "2001-11-12T21+00:00" iso8601_string_test minutes minutes "" "1970-02-07T07:04+00:00" "2001-11-12T21:20+00:00" iso8601_string_test seconds seconds "" "1970-02-07T07:04:03+00:00" "2001-11-12T21:20:00+00:00" - # BSD date(1) does not support fractional seconds at this time. - #iso8601_string_test ns ns "" "1970-02-07T07:04:03,000000000+00:00" "2001-11-12T21:20:00,000000000+00:00" + iso8601_string_test ns ns "" "1970-02-07T07:04:03,000000000+00:00" "2001-11-12T21:20:00,000000000+00:00" } |