aboutsummaryrefslogtreecommitdiff
path: root/tests/new.test
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2018-05-21 18:46:00 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2018-05-21 18:46:00 +0300
commit2ededcf152a4982e9f3caabdd2c91b6966b619d0 (patch)
tree9c2bff30c8cb999990c34301633e59ed9aaacbe9 /tests/new.test
parente1416c9642c9cc1ae45c19cc4e6162b2ac1ff38a (diff)
Add package name validation to new command
Diffstat (limited to 'tests/new.test')
-rw-r--r--tests/new.test50
1 files changed, 38 insertions, 12 deletions
diff --git a/tests/new.test b/tests/new.test
index 9a8c14f..99292b9 100644
--- a/tests/new.test
+++ b/tests/new.test
@@ -34,21 +34,47 @@ status += -d prj
: pkg
:
-: Test creating a library as a separate package in the project.
-:
{
- $* -t empty prj 2>>/"EOE" &prj/***;
- created new empty project prj in $~/prj/
- EOE
+ : add
+ :
+ : Test creating a library as a separate package in the project.
+ :
+ {
+ $* -t empty prj 2>>/"EOE" &prj/***;
+ created new empty project prj in $~/prj/
+ EOE
- $* --package -t lib libprj -d prj 2>>/"EOE";
- created new library package libprj in $~/prj/libprj/
- EOE
+ $* --package -t lib libprj -d prj 2>>/"EOE";
+ created new library package libprj in $~/prj/libprj/
+ EOE
- $build prj/libprj/ $cxx 2>>/~%EOE%
- %.{4}
- %ld prj/libprj/.+%{3}
- EOE
+ $build prj/libprj/ $cxx 2>>/~%EOE%
+ %.{4}
+ %ld prj/libprj/.+%{3}
+ EOE
+ }
+
+ : name
+ :
+ : Test that the package name is validated.
+ :
+ {
+ : project
+ :
+ $* x 2>'error: invalid package name: length is less than two characters' != 0
+
+ : separate
+ :
+ : Here we also test that the project name is not validated as a package.
+ :
+ {
+ $* -t empty x 2>>/"EOE" &x/***;
+ created new empty project x in $~/x/
+ EOE
+
+ $* --package y -d x 2>'error: invalid package name: length is less than two characters' != 0
+ }
+ }
}
: cfg