diff options
author | Karen Arutyunov <karen@codesynthesis.com> | 2017-02-22 00:58:53 +0300 |
---|---|---|
committer | Karen Arutyunov <karen@codesynthesis.com> | 2017-03-15 19:15:55 +0300 |
commit | a791b1ce0fa2bc9859474fb6f7a9c0ff8cbd1d4a (patch) | |
tree | 3c9823a54e6e28a8c8f9fb281d82ad2a67c117ba /tests/rep-add.test | |
parent | 755a99a7ebf24e00675e2f2e0f5184825ad74c4a (diff) |
Port test.sh to testscript
Diffstat (limited to 'tests/rep-add.test')
-rw-r--r-- | tests/rep-add.test | 70 |
1 files changed, 70 insertions, 0 deletions
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 +} |