mirror of
https://github.com/Llewellynvdm/exa.git
synced 2024-11-14 08:24:05 +00:00
61c5df7c11
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.
37 lines
940 B
TOML
37 lines
940 B
TOML
# file name tests
|
||
|
||
[[cmd]]
|
||
name = "‘exa -1’ displays file names, one on each line"
|
||
shell = "exa -1 /testcases/file-names"
|
||
stdout = { file = "outputs/names_lines.ansitxt" }
|
||
stderr = { empty = true }
|
||
status = 0
|
||
tags = [ 'oneline' ]
|
||
|
||
[[cmd]]
|
||
name = "‘exa -1d’ displays, ‘.’, ‘..’, and ‘/’ correctly"
|
||
shell = "exa -1d . .. /"
|
||
stdout = { file = "outputs/dirs_oneline.ansitxt" }
|
||
stderr = { empty = true }
|
||
status = 0
|
||
tags = [ 'oneline', 'list-dirs' ]
|
||
|
||
|
||
# symlinks tests
|
||
|
||
[[cmd]]
|
||
name = "‘exa -1’ lists the destination of symlinks"
|
||
shell = "exa -1 /testcases/links"
|
||
stdout = { file = "outputs/links_lines.ansitxt" }
|
||
stderr = { empty = true }
|
||
status = 0
|
||
tags = [ 'oneline' ]
|
||
|
||
[[cmd]]
|
||
name = "‘exa -1d’ with file arguments lists the destination of symlinks"
|
||
shell = "exa -1d /testcases/links/*"
|
||
stdout = { file = "outputs/links_paths_lines.ansitxt" }
|
||
stderr = { empty = true }
|
||
status = 0
|
||
tags = [ 'oneline', 'list-dirs' ]
|