mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-28 14:46:27 +00:00
More date-related xtests
• Displaying accessed and modified dates • Displaying dates in the distant past and far future (#557)
This commit is contained in:
parent
ef7bb43dbb
commit
d8b21a33b5
@ -190,22 +190,26 @@ echo -e "\033[1m[ 8/13]\033[0m Creating date and time testcases"
|
||||
# there’s no way to touch the created date of a file...
|
||||
# so we have to do this the old-fashioned way!
|
||||
# (and make sure these don't actually get listed)
|
||||
touch -t $OLD_DATE "$TEST_ROOT/dates/peach"; sleep 1
|
||||
touch -t $MED_DATE "$TEST_ROOT/dates/plum"; sleep 1
|
||||
touch -t $NEW_DATE "$TEST_ROOT/dates/pear"
|
||||
touch -t $FIXED_OLD_DATE "$TEST_ROOT/dates/peach"; sleep 1
|
||||
touch -t $FIXED_MED_DATE "$TEST_ROOT/dates/plum"; sleep 1
|
||||
touch -t $FIXED_NEW_DATE "$TEST_ROOT/dates/pear"
|
||||
|
||||
# modified dates
|
||||
touch -t $OLD_DATE -m "$TEST_ROOT/dates/pear"
|
||||
touch -t $MED_DATE -m "$TEST_ROOT/dates/peach"
|
||||
touch -t $NEW_DATE -m "$TEST_ROOT/dates/plum"
|
||||
touch -t $FIXED_OLD_DATE -m "$TEST_ROOT/dates/pear"
|
||||
touch -t $FIXED_MED_DATE -m "$TEST_ROOT/dates/peach"
|
||||
touch -t $FIXED_NEW_DATE -m "$TEST_ROOT/dates/plum"
|
||||
|
||||
# accessed dates
|
||||
touch -t $OLD_DATE -a "$TEST_ROOT/dates/plum"
|
||||
touch -t $MED_DATE -a "$TEST_ROOT/dates/pear"
|
||||
touch -t $NEW_DATE -a "$TEST_ROOT/dates/peach"
|
||||
touch -t $FIXED_OLD_DATE -a "$TEST_ROOT/dates/plum"
|
||||
touch -t $FIXED_MED_DATE -a "$TEST_ROOT/dates/pear"
|
||||
touch -t $FIXED_NEW_DATE -a "$TEST_ROOT/dates/peach"
|
||||
|
||||
sudo chown $FIXED_USER:$FIXED_USER -R "$TEST_ROOT/dates"
|
||||
|
||||
mkdir "$TEST_ROOT/far-dates"
|
||||
touch -t $FIXED_PAST_DATE "$TEST_ROOT/far-dates/the-distant-past"
|
||||
touch -t $FIXED_FUTURE_DATE "$TEST_ROOT/far-dates/beyond-the-future"
|
||||
|
||||
|
||||
# Awkward extended attribute testcases.
|
||||
# We need to test combinations of various numbers of files *and*
|
||||
|
@ -34,6 +34,10 @@ export FIXED_LONG_USER="antidisestablishmentarienism"
|
||||
|
||||
|
||||
# A couple of dates, for date-time testing.
|
||||
export OLD_DATE='200303030000.00'
|
||||
export MED_DATE='200606152314.29' # the june gets used for fr_FR locale tests
|
||||
export NEW_DATE='200912221038.53' # and the december for ja_JP local tests
|
||||
export FIXED_OLD_DATE='200303030000.00'
|
||||
export FIXED_MED_DATE='200606152314.29' # the june gets used for fr_FR locale tests
|
||||
export FIXED_NEW_DATE='200912221038.53' # and the december for ja_JP local tests
|
||||
|
||||
# Dates that extend beyond 32-bit timespace.
|
||||
export FIXED_PAST_DATE='170001010000.00'
|
||||
export FIXED_FUTURE_DATE='230001010000.00'
|
||||
|
@ -1,3 +1,41 @@
|
||||
# various date fields
|
||||
|
||||
[[cmd]]
|
||||
name = "‘exa -lh’ produces a table using the modified time field"
|
||||
shell = "exa -lh /testcases/dates"
|
||||
stdout = { file = "outputs/dates_long_time_modified.ansitxt" }
|
||||
stderr = { empty = true }
|
||||
status = 0
|
||||
tags = [ 'long', 'header', 'time' ]
|
||||
|
||||
[[cmd]]
|
||||
name = "‘exa -lh --time=modified’ produces a table using the modified time field"
|
||||
shell = "exa -lh --time=modified /testcases/dates"
|
||||
stdout = { file = "outputs/dates_long_time_modified.ansitxt" }
|
||||
stderr = { empty = true }
|
||||
status = 0
|
||||
tags = [ 'long', 'header', 'time' ]
|
||||
|
||||
[[cmd]]
|
||||
name = "‘exa -lh --time=accessed’ produces a table using the accessed time field"
|
||||
shell = "exa -lh --time=accessed /testcases/dates"
|
||||
stdout = { file = "outputs/dates_long_time_accessed.ansitxt" }
|
||||
stderr = { empty = true }
|
||||
status = 0
|
||||
tags = [ 'long', 'header', 'time' ]
|
||||
|
||||
|
||||
# distant past and far future dates
|
||||
|
||||
[[cmd]]
|
||||
name = "‘exa -l’ handles dates far past and future dates"
|
||||
shell = "exa -l /testcases/far-dates"
|
||||
stdout = { file = "outputs/far_dates_long.ansitxt" }
|
||||
stderr = { empty = true }
|
||||
status = 0
|
||||
tags = [ 'long', 'time' ]
|
||||
|
||||
|
||||
# alternate date formats
|
||||
|
||||
[[cmd]]
|
||||
|
4
xtests/outputs/dates_long_time_accessed.ansitxt
Normal file
4
xtests/outputs/dates_long_time_accessed.ansitxt
Normal file
@ -0,0 +1,4 @@
|
||||
[4mPermissions[0m [4mSize[0m [4mUser[0m [4mDate Accessed[0m [4mName[0m
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m22 Dec 2009[0m peach
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m15 Jun 2006[0m pear
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m 3 Mar 2003[0m plum
|
4
xtests/outputs/dates_long_time_created.ansitxt
Normal file
4
xtests/outputs/dates_long_time_created.ansitxt
Normal file
@ -0,0 +1,4 @@
|
||||
[4mPermissions[0m [4mSize[0m [4mUser[0m [4mDate Created[0m [4mName[0m
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m17 Oct 14:27[0m peach
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m17 Oct 14:27[0m pear
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m17 Oct 14:27[0m plum
|
4
xtests/outputs/dates_long_time_modified.ansitxt
Normal file
4
xtests/outputs/dates_long_time_modified.ansitxt
Normal file
@ -0,0 +1,4 @@
|
||||
[4mPermissions[0m [4mSize[0m [4mUser[0m [4mDate Modified[0m [4mName[0m
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m15 Jun 2006[0m peach
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m 3 Mar 2003[0m pear
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m cassowary [34m22 Dec 2009[0m plum
|
2
xtests/outputs/far_dates_long.ansitxt
Normal file
2
xtests/outputs/far_dates_long.ansitxt
Normal file
@ -0,0 +1,2 @@
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m [1;33mvagrant[0m [34m 1 Jan 2300[0m beyond-the-future
|
||||
.[1;33mr[31mw[0m[38;5;244m-[33mr[31mw[38;5;244m-[33mr[38;5;244m--[0m [1;32m0[0m [1;33mvagrant[0m [34m 1 Jan 1700[0m the-distant-past
|
Loading…
Reference in New Issue
Block a user