aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2024-09-03 12:41:57 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2024-09-04 13:16:51 +0300
commit228668db1e44fbe6e9eae6b9fdc193d14bf26c46 (patch)
tree7506c14f20957f2c68156be28ba23664a6d8419b /tests
parentf9df0e96ad414c70e87bc2d554095585b3b20721 (diff)
In bdep-publish confirm with user if alpha section is appropriate for package version 0.X.Y (GH issue #422)
Diffstat (limited to 'tests')
-rw-r--r--tests/publish.testscript70
1 files changed, 68 insertions, 2 deletions
diff --git a/tests/publish.testscript b/tests/publish.testscript
index b8b9541..9c0f7e2 100644
--- a/tests/publish.testscript
+++ b/tests/publish.testscript
@@ -31,9 +31,9 @@ g = [cmdline] git -C prj >! 2>!
# Note that using the same package name and version for tests may result in
# duplicate submissions. We will use unique version for each test,
-# incrementing the patch version for 1.0.X.
+# incrementing the patch version for *.*.X.
#
-# Next version to use: 1.0.27
+# Next version to use: *.*.29
#
# Normally we disable the progress indication that complicates stderr output
@@ -129,6 +129,72 @@ g = [cmdline] git -C prj >! 2>!
EOE
}
+ : zero-major-version
+ :
+ {
+ : alpha
+ :
+ {
+ $clone_root_prj;
+ $init -C @cfg &prj-cfg/***;
+ sed -i -e 's/^(version:) .*$/\1 0.1.27/' prj/manifest;
+
+ # Suppress the --yes option.
+ #
+ test.arguments = $regex.apply($test.arguments, '^--yes$', '');
+
+ $* <<EOI 2>>~%EOE%
+ y
+ y
+ EOI
+ %.*
+ package prj 0.1.27 has 0 major version component and should be published to alpha section if this version is semver
+ publish to alpha as opposed to stable [y/n] publishing:
+ %.*
+ package: prj
+ version: 0.1.27
+ project: prj
+ section: alpha
+ %.*
+ continue? [y/n] submitting prj-0.1.27.tar.gz
+ %.*
+ %package submission is queued.+%
+ %reference: .{12}%
+ EOE
+ }
+
+ : stable
+ :
+ {
+ $clone_root_prj;
+ $init -C @cfg &prj-cfg/***;
+ sed -i -e 's/^(version:) .*$/\1 0.1.28/' prj/manifest;
+
+ # Suppress the --yes option.
+ #
+ test.arguments = $regex.apply($test.arguments, '^--yes$', '');
+
+ $* <<EOI 2>>~%EOE%
+ n
+ y
+ EOI
+ %.*
+ package prj 0.1.28 has 0 major version component and should be published to alpha section if this version is semver
+ publish to alpha as opposed to stable [y/n] publishing:
+ %.*
+ package: prj
+ version: 0.1.28
+ project: prj
+ section: stable
+ %.*
+ continue? [y/n] submitting prj-0.1.28.tar.gz
+ %.*
+ %package submission is queued.+%
+ %reference: .{12}%
+ EOE
+ }
+ }
+
: non-standard-version
:
: Test publishing a package with the non-standard version from a