Compare commits

...
2 Commits
Author SHA1 Message Date
Jeremy Pritts 0ed4298585 Bump version to 1.3.1 2023-01-17 01:10:40 -05:00
Jeremy Pritts 3e5ee80680 Fix #21 2023-01-17 01:09:16 -05:00
3 changed files with 8 additions and 6 deletions

No files matched your search

+4 -2
View File
@@ -53,8 +53,10 @@ public class ParsingTests
[Test]
public void ChinaVersionString()
{
string version = "2020.3.15f2c1";
UnityVersion expected = new UnityVersion(2020, 3, 15, UnityVersionType.China, 2);
string version = "2021.3.11f1c2";//This is an actual version from a game.
//Versions like 2019.3.0f2 and 2020.3.15f2 don't have corresponding Chinese versions.
//Source: https://unity.cn/releases
UnityVersion expected = new UnityVersion(2021, 3, 11, UnityVersionType.China, 2);
Assert.Multiple(() =>
{
Assert.AreEqual(expected, UnityVersion.Parse(version));
+3 -3
View File
@@ -9,7 +9,7 @@ public readonly partial struct UnityVersion
private static readonly Regex majorMinorRegex = new Regex(@"^([0-9]+)\.([0-9]+)$", RegexOptions.Compiled);
private static readonly Regex majorMinorBuildRegex = new Regex(@"^([0-9]+)\.([0-9]+)\.([0-9]+)$", RegexOptions.Compiled);
private static readonly Regex normalRegex = new Regex(@"^([0-9]+)\.([0-9]+)\.([0-9]+)\.?([abfpx])([0-9]+)$", RegexOptions.Compiled);
private static readonly Regex chinaRegex = new Regex(@"^([0-9]+)\.([0-9]+)\.([0-9]+)\.?f([0-9]+)c1$", RegexOptions.Compiled);
private static readonly Regex chinaRegex = new Regex(@"^([0-9]+)\.([0-9]+)\.([0-9]+)\.?f1c([0-9]+)$", RegexOptions.Compiled);
/// <summary>
/// Serialize the version as a string
@@ -48,9 +48,9 @@ public readonly partial struct UnityVersion
}
if (Type == UnityVersionType.China)
{
sb.Append('f');
sb.Append("f1");
sb.Append('c');
sb.Append(TypeNumber);
sb.Append("c1");
}
else
{
+1 -1
View File
@@ -8,7 +8,7 @@
<AssemblyName>AssetRipper.VersionUtilities</AssemblyName>
<Authors>ds5678</Authors>
<Company>AssetRipper</Company>
<Version>1.3.0.0</Version>
<Version>1.3.1.0</Version>
<AssemblyVersion>$(Version)</AssemblyVersion>
<PackageId>AssetRipper.VersionUtilities</PackageId>
<PackageTags>C# version unity unity3d</PackageTags>