exa/xtests/sorting.toml
Benjamin Sago 61c5df7c11 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 21:12:18 +01:00

139 lines
4.0 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 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 cant guarantee inode numbers, but we can at least check that theyre 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' ]