From b1c49341c0466861f63ceea1d7c4d867cfda0b9c Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Mon, 12 Apr 2021 21:55:22 +0100 Subject: [PATCH] Add tests for common command-line errors Specifically, making sure that they start with "exa", which is something that's been bugging me recently. --- xtests/errors.toml | 19 +++++++++++++++++++ xtests/outputs/error_invalid_option.ansitxt | 1 + xtests/outputs/error_tree_all_all.ansitxt | 1 + 3 files changed, 21 insertions(+) create mode 100644 xtests/outputs/error_invalid_option.ansitxt create mode 100644 xtests/outputs/error_tree_all_all.ansitxt diff --git a/xtests/errors.toml b/xtests/errors.toml index ed50d9d..7ca0a08 100644 --- a/xtests/errors.toml +++ b/xtests/errors.toml @@ -1,3 +1,22 @@ +# Command-line errors + +[[cmd]] +name = "‘exa --aoeu’ displays an error" +shell = "exa --aoeu" +stdout = { empty = true } +stderr = { file = "outputs/error_invalid_option.ansitxt" } +status = 3 +tags = [ 'error' ] + +[[cmd]] +name = "‘exa -Taa’ displays an error" +shell = "exa -Taa" +stdout = { empty = true } +stderr = { file = "outputs/error_tree_all_all.ansitxt" } +status = 3 +tags = [ 'error' ] + + # Error suggestions [[cmd]] diff --git a/xtests/outputs/error_invalid_option.ansitxt b/xtests/outputs/error_invalid_option.ansitxt new file mode 100644 index 0000000..39825d4 --- /dev/null +++ b/xtests/outputs/error_invalid_option.ansitxt @@ -0,0 +1 @@ +exa: Unknown argument --aoeu diff --git a/xtests/outputs/error_tree_all_all.ansitxt b/xtests/outputs/error_tree_all_all.ansitxt new file mode 100644 index 0000000..b7e21c2 --- /dev/null +++ b/xtests/outputs/error_tree_all_all.ansitxt @@ -0,0 +1 @@ +exa: Option --tree is useless given --all --all