@@ -10,33 +10,41 @@ Set-StrictMode -Version 3.0
1010function Main {
1111 SetUp
1212
13- Test SingleTarget " 1T Default " <# none> <#none#> - Expect ' ^1\.2\.3-local$'
14- Test SingleTarget " 1T Branch " - Branch refs/ heads/ foo <# none#> - Expect ' ^1\.2\.3-foo\.\d{8}\.T\d{6}Z$'
15- Test SingleTarget " 1T Branch " - Branch refs/ heads/ foo <# none#> - Expect ' ^1\.2\.3-foo\.\d{8}\.T\d{6}Z$'
16- Test SingleTarget " 1T Branch + Counter " - Branch refs/ heads/ foo - Counter 42 - Expect ' ^1\.2\.3-foo\.b\.42$'
17- Test SingleTarget " 1T Pull Request " - Branch refs/ pull/ 123 / head <# none#> - Expect ' ^1\.2\.3-pr\.123\.\d{8}\.T\d{6}Z$'
18- Test SingleTarget " 1T Pull Request + Counter" - Branch refs/ pull/ 123 / head - Counter 42 - Expect ' ^1\.2\.3-pr\.123\.b\.42$'
19- Test SingleTarget " 1T Pre-Release " - Branch refs/ tags/ release/ 1.2 .3 - pre <# none#> - Expect ' ^1\.2\.3-pre$'
20- Test SingleTarget " 1T Pre-Release + Counter " - Branch refs/ tags/ release/ 1.2 .3 - pre - Counter 42 - Expect ' ^1\.2\.3-pre$'
21- Test SingleTarget " 1T Release " - Branch refs/ tags/ release/ 1.2 .3 <# none#> - Expect ' ^1\.2\.3$'
22- Test SingleTarget " 1T Release + Counter " - Branch refs/ tags/ release/ 1.2 .3 - Counter 42 - Expect ' ^1\.2\.3$'
23- Test SingleTarget " 1T Invalid " - Branch ?foo?bar? <# none#> - Expect ' ^1\.2\.3--foo-bar-\.\d{8}\.T\d{6}Z$'
24- Test SingleTarget " 1T Invalid + Counter " - Branch ?foo?bar? - Counter 42 - Expect ' ^1\.2\.3--foo-bar-\.b\.42$'
25- Test SingleTarget " 1T Explicit Suffix " - Branch refs/ heads/ foo - Suffix bar - Counter 42 - Expect ' ^1\.2\.3-bar$'
13+ Test SingleTarget " 1T Default " <# none> <#none#> - Expect ' ^1\.2\.3-local$'
14+ Test SingleTarget " 1T Branch " - Branch refs/ heads/ foo <# none#> - Expect ' ^1\.2\.3-foo\.\d{8}\.T\d{6}Z$'
15+ Test SingleTarget " 1T Branch " - Branch refs/ heads/ foo <# none#> - Expect ' ^1\.2\.3-foo\.\d{8}\.T\d{6}Z$'
16+ Test SingleTarget " 1T Branch + Counter " - Branch refs/ heads/ foo - Counter 42 - Expect ' ^1\.2\.3-foo\.b\.42$'
17+ Test SingleTarget " 1T Pull Request " - Branch refs/ pull/ 123 / head <# none#> - Expect ' ^1\.2\.3-pr\.123\.\d{8}\.T\d{6}Z$'
18+ Test SingleTarget " 1T Pull Request + Counter " - Branch refs/ pull/ 123 / head - Counter 42 - Expect ' ^1\.2\.3-pr\.123\.b\.42$'
19+ Test SingleTarget " 1T Pre-Release " - Branch refs/ tags/ release/ 1.2 .3 - pre <# none#> - Expect ' ^1\.2\.3-pre$'
20+ Test SingleTarget " 1T Pre-Release + Counter " - Branch refs/ tags/ release/ 1.2 .3 - pre - Counter 42 - Expect ' ^1\.2\.3-pre$'
21+ Test SingleTarget " 1T Release " - Branch refs/ tags/ release/ 1.2 .3 <# none#> - Expect ' ^1\.2\.3$'
22+ Test SingleTarget " 1T Release + Counter " - Branch refs/ tags/ release/ 1.2 .3 - Counter 42 - Expect ' ^1\.2\.3$'
23+ Test SingleTarget " 1T VTag Pre-Release " - Branch refs/ tags/ v1.2.3 - pre - VTag <# none#> - Expect ' ^1\.2\.3-pre$'
24+ Test SingleTarget " 1T VTag Pre-Release + Counter" - Branch refs/ tags/ v1.2.3 - pre - VTag - Counter 42 - Expect ' ^1\.2\.3-pre$'
25+ Test SingleTarget " 1T VTag Release " - Branch refs/ tags/ v1.2.3 - VTag <# none#> - Expect ' ^1\.2\.3$'
26+ Test SingleTarget " 1T VTag Release + Counter " - Branch refs/ tags/ v1.2.3 - VTag - Counter 42 - Expect ' ^1\.2\.3$'
27+ Test SingleTarget " 1T Invalid " - Branch ?foo?bar? <# none#> - Expect ' ^1\.2\.3--foo-bar-\.\d{8}\.T\d{6}Z$'
28+ Test SingleTarget " 1T Invalid + Counter " - Branch ?foo?bar? - Counter 42 - Expect ' ^1\.2\.3--foo-bar-\.b\.42$'
29+ Test SingleTarget " 1T Explicit Suffix " - Branch refs/ heads/ foo - Suffix bar - Counter 42 - Expect ' ^1\.2\.3-bar$'
2630
27- Test MultiTarget " MT Default " <# none> <#none#> - Expect ' ^1\.2\.3-local$'
28- Test MultiTarget " MT Branch " - Branch refs/ heads/ foo <# none#> - Expect ' ^1\.2\.3-foo\.\d{8}\.T\d{6}Z$'
29- Test MultiTarget " MT Branch " - Branch refs/ heads/ foo <# none#> - Expect ' ^1\.2\.3-foo\.\d{8}\.T\d{6}Z$'
30- Test MultiTarget " MT Branch + Counter " - Branch refs/ heads/ foo - Counter 42 - Expect ' ^1\.2\.3-foo\.b\.42$'
31- Test MultiTarget " MT Pull Request " - Branch refs/ pull/ 123 / head <# none#> - Expect ' ^1\.2\.3-pr\.123\.\d{8}\.T\d{6}Z$'
32- Test MultiTarget " MT Pull Request + Counter" - Branch refs/ pull/ 123 / head - Counter 42 - Expect ' ^1\.2\.3-pr\.123\.b\.42$'
33- Test MultiTarget " MT Pre-Release " - Branch refs/ tags/ release/ 1.2 .3 - pre <# none#> - Expect ' ^1\.2\.3-pre$'
34- Test MultiTarget " MT Pre-Release + Counter " - Branch refs/ tags/ release/ 1.2 .3 - pre - Counter 42 - Expect ' ^1\.2\.3-pre$'
35- Test MultiTarget " MT Release " - Branch refs/ tags/ release/ 1.2 .3 <# none#> - Expect ' ^1\.2\.3$'
36- Test MultiTarget " MT Release + Counter " - Branch refs/ tags/ release/ 1.2 .3 - Counter 42 - Expect ' ^1\.2\.3$'
37- Test MultiTarget " MT Invalid " - Branch ?foo?bar? <# none#> - Expect ' ^1\.2\.3--foo-bar-\.\d{8}\.T\d{6}Z$'
38- Test MultiTarget " MT Invalid + Counter " - Branch ?foo?bar? - Counter 42 - Expect ' ^1\.2\.3--foo-bar-\.b\.42$'
39- Test MultiTarget " MT Explicit Suffix " - Branch refs/ heads/ foo - Suffix bar - Counter 42 - Expect ' ^1\.2\.3-bar$'
31+ Test MultiTarget " MT Default " <# none> <#none#> - Expect ' ^1\.2\.3-local$'
32+ Test MultiTarget " MT Branch " - Branch refs/ heads/ foo <# none#> - Expect ' ^1\.2\.3-foo\.\d{8}\.T\d{6}Z$'
33+ Test MultiTarget " MT Branch " - Branch refs/ heads/ foo <# none#> - Expect ' ^1\.2\.3-foo\.\d{8}\.T\d{6}Z$'
34+ Test MultiTarget " MT Branch + Counter " - Branch refs/ heads/ foo - Counter 42 - Expect ' ^1\.2\.3-foo\.b\.42$'
35+ Test MultiTarget " MT Pull Request " - Branch refs/ pull/ 123 / head <# none#> - Expect ' ^1\.2\.3-pr\.123\.\d{8}\.T\d{6}Z$'
36+ Test MultiTarget " MT Pull Request + Counter " - Branch refs/ pull/ 123 / head - Counter 42 - Expect ' ^1\.2\.3-pr\.123\.b\.42$'
37+ Test MultiTarget " MT Pre-Release " - Branch refs/ tags/ release/ 1.2 .3 - pre <# none#> - Expect ' ^1\.2\.3-pre$'
38+ Test MultiTarget " MT Pre-Release + Counter " - Branch refs/ tags/ release/ 1.2 .3 - pre - Counter 42 - Expect ' ^1\.2\.3-pre$'
39+ Test MultiTarget " MT Release " - Branch refs/ tags/ release/ 1.2 .3 <# none#> - Expect ' ^1\.2\.3$'
40+ Test MultiTarget " MT Release + Counter " - Branch refs/ tags/ release/ 1.2 .3 - Counter 42 - Expect ' ^1\.2\.3$'
41+ Test MultiTarget " MT VTag Pre-Release " - Branch refs/ tags/ v1.2.3 - pre - VTag <# none#> - Expect ' ^1\.2\.3-pre$'
42+ Test MultiTarget " MT VTag Pre-Release + Counter" - Branch refs/ tags/ v1.2.3 - pre - VTag - Counter 42 - Expect ' ^1\.2\.3-pre$'
43+ Test MultiTarget " MT VTag Release " - Branch refs/ tags/ v1.2.3 - VTag <# none#> - Expect ' ^1\.2\.3$'
44+ Test MultiTarget " MT VTag Release + Counter " - Branch refs/ tags/ v1.2.3 - VTag - Counter 42 - Expect ' ^1\.2\.3$'
45+ Test MultiTarget " MT Invalid " - Branch ?foo?bar? <# none#> - Expect ' ^1\.2\.3--foo-bar-\.\d{8}\.T\d{6}Z$'
46+ Test MultiTarget " MT Invalid + Counter " - Branch ?foo?bar? - Counter 42 - Expect ' ^1\.2\.3--foo-bar-\.b\.42$'
47+ Test MultiTarget " MT Explicit Suffix " - Branch refs/ heads/ foo - Suffix bar - Counter 42 - Expect ' ^1\.2\.3-bar$'
4048}
4149
4250function SetUp {
@@ -50,6 +58,7 @@ function Test {
5058 [Parameter (Mandatory , Position = 0 )] [string ] $Project ,
5159 [Parameter (Mandatory , Position = 1 )] [string ] $Name ,
5260 [Parameter ()] [string ] $Branch ,
61+ [Parameter ()] [switch ] $VTag ,
5362 [Parameter ()] [int ] $Counter ,
5463 [Parameter ()] [string ] $Suffix ,
5564 [Parameter (Mandatory )] [regex ] $Expect
@@ -64,6 +73,7 @@ function Test {
6473 " --no-restore"
6574 " --configuration:Release"
6675 if ($Suffix ) { " --version-suffix:$Suffix " }
76+ if ($VTag ) { " -p:VersionTagPrefix=v" }
6777 if ($Branch ) { " -p:Branch=$Branch " }
6878 if ($Counter ) { " -p:Counter=$Counter " }
6979 )
0 commit comments