Use Specsheet for the extended tests
This commit changes the way the extended test suite is run.
Previously, there was a folder full of outputs, and a script that ran exa repeatedly to check the outputs match. This script was hacked-together, with many problems:
• It stops at the first failure, so if one test fails, you have no idea how many actually failed.
• It also didn't actually show you the diff if one was different, it just checked it.
• It combined stdout and stderr, and didn't test the exit status of exa.
• All the output file names were just whatever I felt like calling the file at the time.
• There is no way to only run a few of the tests — you have to run the whole thing each time.
• There's no feel-good overall view where you see how many tests are passing.
I started writing Specsheet to solve this problem (amongst other problems), and now, three and a half years later, it's finally ready for prime time.
The tests are now defined as data rather than as a script. The outputs have a consistent naming convention (directory_flags.ansitxt), and they check stdout, stderr, and exit status separately. Specsheet also lets simple outputs (empty, non-empty, or one-line error messages) can be written inline rather than needing to be in files.
So even though this pretty much runs the same tests as the run.sh script did, the tests are now more organised, making it easy to see where tests are missing and functionality is not being tested.
2020-10-17 19:39:44 +00:00
|
|
|
|
# sorting by name
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=name’ sorts by file name"
|
|
|
|
|
shell = "exa -1 --sort=name /testcases/file-names-exts"
|
|
|
|
|
stdout = { file = "outputs/exts_oneline_sort_name.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=Name’ sorts by file name (case-sensitively)"
|
|
|
|
|
shell = "exa -1 --sort=Name /testcases/file-names-exts"
|
|
|
|
|
stdout = { file = "outputs/exts_oneline_sort_namecase.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort' ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# sorting by file extension
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=ext’ sorts by file extension"
|
|
|
|
|
shell = "exa -1 --sort=ext /testcases/file-names-exts"
|
|
|
|
|
stdout = { file = "outputs/exts_oneline_sort_ext.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=Ext’ sorts by file extension (case-sensitively)"
|
|
|
|
|
shell = "exa -1 --sort=Ext /testcases/file-names-exts"
|
|
|
|
|
stdout = { file = "outputs/exts_oneline_sort_extcase.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort' ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# sorting by kind
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=type’ sorts by file kind (files and symlinks)"
|
|
|
|
|
shell = "exa -1 --sort=type /testcases/links"
|
|
|
|
|
stdout = { file = "outputs/links_oneline_sort_type.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=type’ sorts by file kind (special files)"
|
|
|
|
|
shell = "exa -1 --sort=type /testcases/specials"
|
|
|
|
|
stdout = { file = "outputs/specials_oneline_sort_type.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort' ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# sorting by inode
|
|
|
|
|
|
|
|
|
|
# We can’t guarantee inode numbers, but we can at least check that they’re in
|
|
|
|
|
# order. The inode column is the leftmost one, so sort works for this.
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -l --inode --sort=inode’ sorts by file inode"
|
|
|
|
|
shell = "exa -l --inode --sort=inode /testcases/file-names-exts | sort --check"
|
|
|
|
|
stdout = { empty = true }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'long', 'inode', 'sort' ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# sorting by modified date
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=modified’ sorts most recently modified at the bottom"
|
|
|
|
|
shell = "exa -1 --sort=modified /testcases/dates"
|
|
|
|
|
stdout = { string = "pear\npeach\nplum" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort', 'dates' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=modified -r’ sorts most recently modified at the top"
|
|
|
|
|
shell = "exa -1 --sort=modified -r /testcases/dates"
|
|
|
|
|
stdout = { string = "plum\npeach\npear" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort', 'dates', 'reverse' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=newest’ sorts most recently modified at the bottom"
|
|
|
|
|
shell = "exa -1 --sort=newest /testcases/dates"
|
|
|
|
|
stdout = { string = "pear\npeach\nplum" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort', 'dates' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=newest -r’ sorts most recently modified at the top"
|
|
|
|
|
shell = "exa -1 --sort=newest -r /testcases/dates"
|
|
|
|
|
stdout = { string = "plum\npeach\npear" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort', 'dates', 'reverse' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=oldest’ sorts most recently modified at the top"
|
|
|
|
|
shell = "exa -1 --sort=oldest /testcases/dates"
|
|
|
|
|
stdout = { string = "plum\npeach\npear" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort', 'dates' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=oldest -r’ sorts most recently modified at the bottom"
|
|
|
|
|
shell = "exa -1 --sort=oldest -r /testcases/dates"
|
|
|
|
|
stdout = { string = "pear\npeach\nplum" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort', 'dates', 'reverse' ]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# sorting by other date fields
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=created’ sorts by created date"
|
|
|
|
|
shell = "exa -1 --sort=created /testcases/dates"
|
|
|
|
|
stdout = { string = "peach\nplum\npear" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort', 'dates' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
|
|
|
|
name = "‘exa -1 --sort=accessed’ sorts by accessed date"
|
|
|
|
|
shell = "exa -1 --sort=accessed /testcases/dates"
|
|
|
|
|
stdout = { string = "plum\npear\npeach" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort', 'dates' ]
|
2020-10-23 19:08:12 +00:00
|
|
|
|
|
|
|
|
|
# sorting with arguments specified
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
2021-01-15 21:25:50 +00:00
|
|
|
|
name = "‘exa -G --sort=name -r’ with file arguments sorts by file name in reverse order"
|
|
|
|
|
shell = "cd /testcases/file-names-exts; exa -G --sort=name -r *"
|
2020-10-23 19:08:12 +00:00
|
|
|
|
environment = { COLUMNS = "80" }
|
|
|
|
|
stdout = { file = "outputs/exts_grid_sort_name_reverse.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'grid', 'sort', 'reverse' ]
|
|
|
|
|
|
|
|
|
|
[[cmd]]
|
2021-01-15 21:25:50 +00:00
|
|
|
|
name = "‘exa -1 --sort=name -r’ with file arguments sorts by file name in reverse order"
|
|
|
|
|
shell = "cd /testcases/file-names-exts; exa -1 --sort=name -r *"
|
2020-10-23 19:08:12 +00:00
|
|
|
|
stdout = { file = "outputs/exts_oneline_sort_name_reverse.ansitxt" }
|
|
|
|
|
stderr = { empty = true }
|
|
|
|
|
status = 0
|
|
|
|
|
tags = [ 'oneline', 'sort', 'reverse' ]
|