Bladeren bron

Add tests for common command-line errors

Specifically, making sure that they start with "exa", which is something that's been bugging me recently.
Benjamin Sago 4 jaren geleden
bovenliggende
commit
b1c49341c0
3 gewijzigde bestanden met toevoegingen van 21 en 0 verwijderingen
  1. 19 0
      xtests/errors.toml
  2. 1 0
      xtests/outputs/error_invalid_option.ansitxt
  3. 1 0
      xtests/outputs/error_tree_all_all.ansitxt

+ 19 - 0
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]]

+ 1 - 0
xtests/outputs/error_invalid_option.ansitxt

@@ -0,0 +1 @@
+exa: Unknown argument --aoeu

+ 1 - 0
xtests/outputs/error_tree_all_all.ansitxt

@@ -0,0 +1 @@
+exa: Option --tree is useless given --all --all