From a791b1ce0fa2bc9859474fb6f7a9c0ff8cbd1d4a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Wed, 22 Feb 2017 00:58:53 +0300 Subject: Port test.sh to testscript --- tests/rep-add.test | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 tests/rep-add.test (limited to 'tests/rep-add.test') diff --git a/tests/rep-add.test b/tests/rep-add.test new file mode 100644 index 0000000..a1b9104 --- /dev/null +++ b/tests/rep-add.test @@ -0,0 +1,70 @@ +# file : tests/rep-add.test +# copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +# license : MIT; see accompanying LICENSE file + +.include common.test config.test + +: location +: +{ + : none + : + $* 2>>EOE != 0 + error: repository location argument expected + info: run 'bpkg help rep-add' for more information + EOE + + : no-version + : + $* 'stable' 2>>EOE != 0 + error: invalid repository location 'stable': missing repository version + EOE + + : invalid-host + : + $* 'http://' 2>>EOE != 0 + error: invalid repository location 'http://': invalid host + EOE +} + +: relative-path +: +{ + $clone_cfg; + + $* ./1/bar/stable 2>>/~%EOE%; + %added repository .+/relative-path/bar/stable% + EOE + + $* ./1/../1/bar/stable 2>>/~%EOE% != 0 + %error: .+/relative-path/bar/stable is already a repository of this configuration% + EOE +} + +: absolute-path +: +{ + $clone_cfg; + + $* $~/1/foo/stable 2>>/~%EOE%; + %added repository .+/absolute-path/foo/stable% + EOE + + $* $~/1/../1/foo/stable 2>>/~%EOE% != 0 + %error: .+/absolute-path/foo/stable is already a repository of this configuration% + EOE +} + +: remote-url +: +{ + $clone_cfg; + + $* 'http://pkg.example.org/1/testing' 2>>~%EOE%; + %added repository example.org/testing% + EOE + + $* 'https://www.example.org/1/testing' 2>>~%EOE% != 0 + %error: example.org/testing is already a repository of this configuration% + EOE +} -- cgit v1.1