aboutsummaryrefslogtreecommitdiff
path: root/tests/pkg-verify.test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2017-02-22 00:58:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2017-03-15 19:15:55 +0300
commita791b1ce0fa2bc9859474fb6f7a9c0ff8cbd1d4a (patch)
tree3c9823a54e6e28a8c8f9fb281d82ad2a67c117ba /tests/pkg-verify.test
parent755a99a7ebf24e00675e2f2e0f5184825ad74c4a (diff)
Port test.sh to testscript
Diffstat (limited to 'tests/pkg-verify.test')
-rw-r--r--tests/pkg-verify.test59
1 files changed, 59 insertions, 0 deletions
diff --git a/tests/pkg-verify.test b/tests/pkg-verify.test
new file mode 100644
index 0000000..9d9c714
--- /dev/null
+++ b/tests/pkg-verify.test
@@ -0,0 +1,59 @@
+# file : tests/pkg-verify.test
+# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+.include common.test
+
+# Source repository:
+#
+# pkg-verify
+# |-- foo-1.tar.gz
+# |-- foo-2.tar.gz (manifest with unknown name)
+# `-- not-a-package.tar.gz
+
+: valid-package
+:
+$* $src/foo-1.tar.gz 2>'valid package foo 1'
+
+: no-package
+:
+$* 2>>EOE != 0
+error: archive path argument expected
+ info: run 'bpkg help pkg-verify' for more information
+EOE
+
+: not-a-package
+:
+{
+ : verbose
+ :
+ $* $src/not-a-package.tar.gz 2>>/~%EOE% != 0
+ %.+
+ %error: .+/not-a-package.tar.gz does not appear to be a bpkg package%
+ EOE
+
+ : silent
+ :
+ $* --silent $src/not-a-package.tar.gz != 0
+}
+
+: unknown-name
+:
+: Test that package manifest that contains an unknown name is properly handled.
+:
+{
+ : verbose
+ :
+ $* $src/foo-2.tar.gz 2>>/~%EOE% != 0
+ foo-2/manifest:8:1: error: unknown name 'color' in package manifest
+ % info: package archive .+/foo-2.tar.gz%
+ EOE
+
+ : silent
+ :
+ $* --silent $src/foo-2.tar.gz != 0
+
+ : ignore
+ :
+ $* --ignore-unknown $src/foo-2.tar.gz 2>'valid package foo 2'
+}