From 5fe8e2afd6533a49eb23f1d105e1ddfd3b9d4092 Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Mon, 18 Sep 2023 19:00:33 -0700 Subject: [PATCH] cmd: Add test cases for sortAscending --- cmd/hvm/testscripts/use_check_sort_order.txt | 35 ++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 cmd/hvm/testscripts/use_check_sort_order.txt diff --git a/cmd/hvm/testscripts/use_check_sort_order.txt b/cmd/hvm/testscripts/use_check_sort_order.txt new file mode 100644 index 0000000..64dafa4 --- /dev/null +++ b/cmd/hvm/testscripts/use_check_sort_order.txt @@ -0,0 +1,35 @@ +# User cache and config dirs (we use os.UserCacheDir and os.UserCongfigDir) +[darwin] env HOME=home +[darwin] mkdir "$HOME/Library/Caches" +[darwin] mkdir "$HOME/Library/Application Support" +[linux] env XDG_CACHE_HOME=cache +[linux] env XDG_CONFIG_HOME=config +[windows] env LocalAppData=cache +[windows] env AppData=config + +# https://github.com/actions/runner-images/issues/602 +[darwin] skip + +# Test 1 +env HVM_NUMTAGSTODISPLAY=-1 +env HVM_SORTASCENDING=true +exec hvm use +stdin input.txt +stdout '\D1\) v0\.54\.0' + +env HVM_NUMTAGSTODISPLAY=-1 +env HVM_SORTASCENDING=false +stdin input.txt +exec hvm use +! stdout '\D1\) v0\.54\.0' + +env HVM_NUMTAGSTODISPLAY=30 +env HVM_SORTASCENDING=false +stdin input.txt +exec hvm use +! stdout '\D1\) v0\.54\.0' +! stdout '\D30\) v0\.54\.0' + +# Files +-- input.txt -- +1