From 4e90b4d7e39eeec4f763834665ec2d5747798def Mon Sep 17 00:00:00 2001 From: Benjamin Sago Date: Sun, 25 Jun 2017 11:53:59 +0100 Subject: [PATCH] Tests for disabling colours --- xtests/files_l_bw | 39 +++++++++++++++++++++++++++++++++++++++ xtests/run.sh | 15 ++++++++++----- 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 xtests/files_l_bw diff --git a/xtests/files_l_bw b/xtests/files_l_bw new file mode 100644 index 0000000..8764a1b --- /dev/null +++ b/xtests/files_l_bw @@ -0,0 +1,39 @@ +.rw-r--r-- 1.0k cassowary 1 Jan 12:34 1_KiB +.rw-r--r-- 1.0M cassowary 1 Jan 12:34 1_MiB +.rw-r--r-- 1 cassowary 1 Jan 12:34 1_bytes +.rw-r--r-- 2.0k cassowary 1 Jan 12:34 2_KiB +.rw-r--r-- 2.1M cassowary 1 Jan 12:34 2_MiB +.rw-r--r-- 2 cassowary 1 Jan 12:34 2_bytes +.rw-r--r-- 3.1k cassowary 1 Jan 12:34 3_KiB +.rw-r--r-- 3.1M cassowary 1 Jan 12:34 3_MiB +.rw-r--r-- 3 cassowary 1 Jan 12:34 3_bytes +.rw-r--r-- 4.1k cassowary 1 Jan 12:34 4_KiB +.rw-r--r-- 4.2M cassowary 1 Jan 12:34 4_MiB +.rw-r--r-- 4 cassowary 1 Jan 12:34 4_bytes +.rw-r--r-- 5.1k cassowary 1 Jan 12:34 5_KiB +.rw-r--r-- 5.2M cassowary 1 Jan 12:34 5_MiB +.rw-r--r-- 5 cassowary 1 Jan 12:34 5_bytes +.rw-r--r-- 6.1k cassowary 1 Jan 12:34 6_KiB +.rw-r--r-- 6.3M cassowary 1 Jan 12:34 6_MiB +.rw-r--r-- 6 cassowary 1 Jan 12:34 6_bytes +.rw-r--r-- 7.2k cassowary 1 Jan 12:34 7_KiB +.rw-r--r-- 7.3M cassowary 1 Jan 12:34 7_MiB +.rw-r--r-- 7 cassowary 1 Jan 12:34 7_bytes +.rw-r--r-- 8.2k cassowary 1 Jan 12:34 8_KiB +.rw-r--r-- 8.4M cassowary 1 Jan 12:34 8_MiB +.rw-r--r-- 8 cassowary 1 Jan 12:34 8_bytes +.rw-r--r-- 9.2k cassowary 1 Jan 12:34 9_KiB +.rw-r--r-- 9.4M cassowary 1 Jan 12:34 9_MiB +.rw-r--r-- 9 cassowary 1 Jan 12:34 9_bytes +.rw-r--r-- 10k cassowary 1 Jan 12:34 10_KiB +.rw-r--r-- 10M cassowary 1 Jan 12:34 10_MiB +.rw-r--r-- 10 cassowary 1 Jan 12:34 10_bytes +.rw-r--r-- 11k cassowary 1 Jan 12:34 11_KiB +.rw-r--r-- 11M cassowary 1 Jan 12:34 11_MiB +.rw-r--r-- 11 cassowary 1 Jan 12:34 11_bytes +.rw-r--r-- 12k cassowary 1 Jan 12:34 12_KiB +.rw-r--r-- 12M cassowary 1 Jan 12:34 12_MiB +.rw-r--r-- 12 cassowary 1 Jan 12:34 12_bytes +.rw-r--r-- 13k cassowary 1 Jan 12:34 13_KiB +.rw-r--r-- 13M cassowary 1 Jan 12:34 13_MiB +.rw-r--r-- 13 cassowary 1 Jan 12:34 13_bytes diff --git a/xtests/run.sh b/xtests/run.sh index d84c686..4ef39fe 100755 --- a/xtests/run.sh +++ b/xtests/run.sh @@ -2,14 +2,17 @@ set +xe -# The exa binary we want to run -exa="$HOME/target/debug/exa --colour=always" +# The exa binary +exa_binary="$HOME/target/debug/exa" + +# The exa command that ends up being run +exa="$exa_binary --colour=always" # Directory containing our awkward testcase files -testcases=/testcases +testcases="/testcases" # Directory containing existing test results to compare against -results=/vagrant/xtests +results="/vagrant/xtests" # Check that no files were created more than a year ago. @@ -25,7 +28,9 @@ $exa $testcases/files -lhb | diff -q - $results/files_lhb || exit 1 $exa $testcases/files -lhB | diff -q - $results/files_lhb2 || exit 1 $exa $testcases/attributes/dirs/empty-with-attribute -lh | diff -q - $results/empty || exit 1 -$exa $testcases/files -l --color-scale | diff -q - $results/files_l_scale || exit 1 +$exa --color-scale $testcases/files -l | diff -q - $results/files_l_scale || exit 1 +$exa_binary $testcases/files -l | diff -q - $results/files_l_bw || exit 1 +$exa_binary --colour=never $testcases/files -l | diff -q - $results/files_l_bw || exit 1 # Grid view tests