From 466786d36a845b53e248c49e6c7917f322c20acd Mon Sep 17 00:00:00 2001 From: Joe Mooring Date: Sun, 26 May 2024 10:34:09 -0700 Subject: [PATCH] cmd/testscript: Add tests for --latest flag --- cmd/testscripts/{ => install}/install.txtar | 0 cmd/testscripts/install/install_latest.txtar | 13 +++++++++++++ cmd/testscripts/use/use_latest.txtar | 12 ++++++++++++ 3 files changed, 25 insertions(+) rename cmd/testscripts/{ => install}/install.txtar (100%) create mode 100644 cmd/testscripts/install/install_latest.txtar create mode 100644 cmd/testscripts/use/use_latest.txtar diff --git a/cmd/testscripts/install.txtar b/cmd/testscripts/install/install.txtar similarity index 100% rename from cmd/testscripts/install.txtar rename to cmd/testscripts/install/install.txtar diff --git a/cmd/testscripts/install/install_latest.txtar b/cmd/testscripts/install/install_latest.txtar new file mode 100644 index 0000000..8216603 --- /dev/null +++ b/cmd/testscripts/install/install_latest.txtar @@ -0,0 +1,13 @@ +# 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 + +# Test +exec hvm install --latest +stdout 'Downloading v.* done.\n' +stdout 'Installation of v.* complete.\n' diff --git a/cmd/testscripts/use/use_latest.txtar b/cmd/testscripts/use/use_latest.txtar new file mode 100644 index 0000000..34fcbab --- /dev/null +++ b/cmd/testscripts/use/use_latest.txtar @@ -0,0 +1,12 @@ +# 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 + +# Test +exec hvm use --latest +stdout 'Downloading v.* done.\n'