@@ -20,6 +20,7 @@ public class SemanticVersionTests : TestBase
20
20
[ TestCase ( "1.2-alpha4" , 1 , 2 , 0 , "alpha" , 4 , null , null , null , null , "1.2.0-alpha.4" , null ) ]
21
21
[ TestCase ( "1.2.3-rc" , 1 , 2 , 3 , "rc" , null , null , null , null , null , null , null ) ]
22
22
[ TestCase ( "1.2.3-rc3" , 1 , 2 , 3 , "rc" , 3 , null , null , null , null , "1.2.3-rc.3" , null ) ]
23
+ [ TestCase ( "1.2.3-3" , 1 , 2 , 3 , "" , 3 , null , null , null , null , "1.2.3-3" , null ) ]
23
24
[ TestCase ( "1.2.3-RC3" , 1 , 2 , 3 , "RC" , 3 , null , null , null , null , "1.2.3-RC.3" , null ) ]
24
25
[ TestCase ( "1.2.3-rc3.1" , 1 , 2 , 3 , "rc3" , 1 , null , null , null , null , "1.2.3-rc3.1" , null ) ]
25
26
[ TestCase ( "01.02.03-rc03" , 1 , 2 , 3 , "rc" , 3 , null , null , null , null , "1.2.3-rc.3" , null ) ]
@@ -119,6 +120,21 @@ public void ToStringSTests()
119
120
}
120
121
} ;
121
122
Assert . AreEqual ( "1.2.3-beta.4" , fullSemVer . ToString ( "s" ) ) ;
123
+ var fullSemVerNoPreReleaseName = new SemanticVersion
124
+ {
125
+ Major = 1 ,
126
+ Minor = 2 ,
127
+ Patch = 3 ,
128
+ PreReleaseTag = new SemanticVersionPreReleaseTag ( "" , 4 ) ,
129
+ BuildMetaData = new SemanticVersionBuildMetaData
130
+ {
131
+ Sha = "theSha" ,
132
+ Branch = "TheBranch" ,
133
+ CommitsSinceTag = 5 ,
134
+ OtherMetaData = "TheOtherMetaData"
135
+ }
136
+ } ;
137
+ Assert . AreEqual ( "1.2.3-4" , fullSemVerNoPreReleaseName . ToString ( "s" ) ) ;
122
138
}
123
139
[ Test ]
124
140
public void ToStringLTests ( )
@@ -183,6 +199,21 @@ public void ToStringTests()
183
199
}
184
200
} ;
185
201
Assert . AreEqual ( "1.2.3-beta.4" , fullSemVer . ToString ( ) ) ;
202
+ var fullSemVerNoPreReleaseName = new SemanticVersion
203
+ {
204
+ Major = 1 ,
205
+ Minor = 2 ,
206
+ Patch = 3 ,
207
+ PreReleaseTag = new SemanticVersionPreReleaseTag ( "" , 4 ) ,
208
+ BuildMetaData = new SemanticVersionBuildMetaData
209
+ {
210
+ Sha = "theSha" ,
211
+ Branch = "TheBranch" ,
212
+ CommitsSinceTag = 5 ,
213
+ OtherMetaData = "TheOtherMetaData"
214
+ }
215
+ } ;
216
+ Assert . AreEqual ( "1.2.3-4" , fullSemVerNoPreReleaseName . ToString ( ) ) ;
186
217
}
187
218
[ Test ]
188
219
public void ToStringFTests ( )
0 commit comments