Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/freebsd/poudriere.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Drewery <bryan@shatow.net>2022-09-09 23:39:16 +0300
committerBryan Drewery <bryan@shatow.net>2022-11-05 18:47:57 +0300
commit5dd69d889844f0c3d2ad5134f9513f71e457c63f (patch)
treef56cb62042a293a651672e25829cb64aa2d2fe21
parentdaf8d54a1af43111aa9fd02c7462533352e0d823 (diff)
display test: Add more cases
-rw-r--r--test/display.sh61
1 files changed, 61 insertions, 0 deletions
diff --git a/test/display.sh b/test/display.sh
index 17d1eab1..0c77db10 100644
--- a/test/display.sh
+++ b/test/display.sh
@@ -53,6 +53,67 @@ alias assert_file='_assert_file "$0:$LINENO"'
}
{
+ display_setup "%s %s" "-k2,2V -k1,1d"
+ display_add "Name" "Release"
+ display_add "blah" "11.2-RELEASE-p1"
+ display_add "blah" "10.0-RELEASE"
+ display_add "blah" "10.2-RELEASE"
+ display_add "blah" "10.2-RELEASE-p10"
+ display_add "blah2" "10.2-RELEASE-p1"
+ display_add "blah" "10.2-RELEASE-p1"
+ display_add "blah" "9.3-RELEASE-p10"
+ display_add "blah" "9.3-RELEASE-p1"
+ display_add "blah" "8.2-RELEASE-p1"
+ outfile=$(mktemp -t outfile)
+ display_output > "${outfile}"
+ expected=$(mktemp -t expected)
+ cat > "${expected}" <<-EOF
+ Name Release
+ blah 8.2-RELEASE-p1
+ blah 9.3-RELEASE-p1
+ blah 9.3-RELEASE-p10
+ blah 10.0-RELEASE
+ blah 10.2-RELEASE
+ blah 10.2-RELEASE-p1
+ blah2 10.2-RELEASE-p1
+ blah 10.2-RELEASE-p10
+ blah 11.2-RELEASE-p1
+ EOF
+ assert_file "${expected}" "${outfile}"
+}
+
+{
+ # Test no trailing spaces
+ display_setup "%%-%ds %%s" "-k2,2V -k1,1d"
+ display_add "Name" "Release"
+ display_add "blah" "11.2-RELEASE-p1"
+ display_add "blah" "10.0-RELEASE"
+ display_add "blah" "10.2-RELEASE"
+ display_add "blah" "10.2-RELEASE-p10"
+ display_add "blah2" "10.2-RELEASE-p1"
+ display_add "blah" "10.2-RELEASE-p1"
+ display_add "blah" "9.3-RELEASE-p10"
+ display_add "blah" "9.3-RELEASE-p1"
+ display_add "blah" "8.2-RELEASE-p1"
+ outfile=$(mktemp -t outfile)
+ display_output > "${outfile}"
+ expected=$(mktemp -t expected)
+ cat > "${expected}" <<-EOF
+ Name Release
+ blah 8.2-RELEASE-p1
+ blah 9.3-RELEASE-p1
+ blah 9.3-RELEASE-p10
+ blah 10.0-RELEASE
+ blah 10.2-RELEASE
+ blah 10.2-RELEASE-p1
+ blah2 10.2-RELEASE-p1
+ blah 10.2-RELEASE-p10
+ blah 11.2-RELEASE-p1
+ EOF
+ assert_file "${expected}" "${outfile}"
+}
+
+{
# Test a case that was totally wrong due to quoting the first field
display_setup "%%%ds %%-%ds %%-%ds" "-k1,1n"
display_add "JID" "IP Address" "vnet_num"