-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_increment.sh
More file actions
70 lines (58 loc) · 1.64 KB
/
test_increment.sh
File metadata and controls
70 lines (58 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# @data_provider data_increment_patch
function test_increment_patch() {
ver=$(bin/version increment $1);
assert_equals $ver $2;
}
# @data_provider data_increment_minor
function test_increment_minor() {
ver=$(bin/version increment $1 --part minor);
assert_equals $ver $2;
}
# @data_provider data_increment_major
function test_increment_major() {
ver=$(bin/version increment $1 --part major);
assert_equals $ver $2;
}
# @data_provider data_increment_with_pre_release
function test_increment_with_prerelease() {
ver=$(bin/version increment $1 --pre alpha);
assert_equals $ver $2;
}
# @data_provider data_increment_with_build
function test_increment_with_build() {
ver=$(bin/version increment $1 --build 123);
assert_equals $ver $2;
}
# @data_provider data_increment_with_pre_release_and_build
function test_increment_with_pre_release_and_build() {
ver=$(bin/version increment $1 --build 123 --pre alpha);
assert_equals $ver $2;
}
# @data_provider data_increment_prerelease
function test_increment_with_prerelease_and_build() {
ver=$(bin/version increment $1 --part prerelease);
assert_equals $ver $2;
}
function data_increment_prerelease() {
echo "1.0.0-beta" "1.0.0-beta.1";
}
function data_increment_patch() {
echo "0.0.0" "0.0.1";
echo "1.0.0" "1.0.1";
}
function data_increment_minor() {
echo "0.0.0" "0.1.0";
echo "1.0.0" "1.1.0";
}
function data_increment_major() {
echo "0.0.0" "1.0.0";
echo "1.0.0" "2.0.0";
}
function data_increment_with_pre_release() {
echo "0.0.0" "0.0.1-alpha";
echo "1.0.0" "1.0.1-alpha";
}
function data_increment_with_pre_release_and_build() {
echo "0.0.0" "0.0.1-alpha+123";
echo "1.0.0" "1.0.1-alpha+123";
}