aboutsummaryrefslogtreecommitdiff
path: root/tests/pkg-verify.testscript
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-09-04 14:02:11 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-09-04 14:02:11 +0300
commitf8fdb500cc705e2b8b4a74166ceb2c6d8cee3fd3 (patch)
tree3f94b0b79ebad275904b9dc4a4165326ff598492 /tests/pkg-verify.testscript
parentf727c2b8fe273a12d059826291523060dab4b512 (diff)
Rename .test/test{} to .testscript/testscript{}
Diffstat (limited to 'tests/pkg-verify.testscript')
-rw-r--r--tests/pkg-verify.testscript71
1 files changed, 71 insertions, 0 deletions
diff --git a/tests/pkg-verify.testscript b/tests/pkg-verify.testscript
new file mode 100644
index 0000000..559b612
--- /dev/null
+++ b/tests/pkg-verify.testscript
@@ -0,0 +1,71 @@
+# file : tests/pkg-verify.testscript
+# copyright : Copyright (c) 2014-2018 Code Synthesis Ltd
+# license : MIT; see accompanying LICENSE file
+
+.include common.testscript
+
+# 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'
+
+: manifest
+:
+$* --manifest $src/foo-1.tar.gz >>EOO
+ : 1
+ name: foo
+ version: 1
+ summary: The "Foo" utility
+ license: MIT
+ url: http://www.example.org/foo
+ email: foo-users@example.org
+ EOO
+
+: 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'
+}