mirror of
https://github.com/AssetRipper/AssetRipper.Primitives.git
synced 2026-11-13 04:26:30 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ca701a43dc | ||
|
|
f478cd8015 | ||
|
|
8cd69e8946 | ||
|
|
3cba893ff2 |
No files matched your search
@@ -14,7 +14,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4.0.0
|
||||
uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
- name: Restore dependencies
|
||||
@@ -31,7 +31,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4.0.0
|
||||
uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: 7.0.x
|
||||
- name: Restore dependencies
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4.0.0
|
||||
uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: 6.0.x
|
||||
- name: Restore dependencies
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v4.0.0
|
||||
uses: actions/setup-dotnet@v4.1.0
|
||||
with:
|
||||
dotnet-version: 5.0.x
|
||||
- name: Restore dependencies
|
||||
|
||||
@@ -73,6 +73,22 @@ public class ParsingTests
|
||||
});
|
||||
}
|
||||
|
||||
[TestCase("g2019")]
|
||||
[TestCase("g2019.4")]
|
||||
[TestCase("g2019.4.3")]
|
||||
[TestCase("g2019.4.3f")]
|
||||
[TestCase("g2019.4.3f1")]
|
||||
[TestCase("g2019.4.3f1c1")]
|
||||
[TestCase("2019g")]
|
||||
[TestCase("2019.4g")]
|
||||
[TestCase("2019.4.3g")]
|
||||
[TestCase("2019.4.3fg")]
|
||||
// "2019.4.3f1g" and "2019.4.3f1c1g" are technically valid because custom engines often append some text to the version string.
|
||||
public void InvalidVersionStringFailsToParse(string versionString)
|
||||
{
|
||||
Assert.That(UnityVersion.TryParse(versionString, out _, out _), Is.False);
|
||||
}
|
||||
|
||||
private static IEnumerable<UnityVersion> GenerateRandomVersions(int count)
|
||||
{
|
||||
Randomizer random = TestContext.CurrentContext.Random;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<Authors>ds5678</Authors>
|
||||
<Company>AssetRipper</Company>
|
||||
<Version>3.1.3</Version>
|
||||
<Version>3.1.4</Version>
|
||||
<AssemblyVersion>$(Version)</AssemblyVersion>
|
||||
<PackageId>AssetRipper.Primitives</PackageId>
|
||||
<PackageTags>C# assetripper unity unity3d</PackageTags>
|
||||
|
||||
@@ -12,19 +12,19 @@ internal static partial class UnityVersionRegexes
|
||||
#endif
|
||||
|
||||
[StringSyntax("regex")]
|
||||
private const string Major = @"([0-9]+)";
|
||||
private const string Major = @"^([0-9]+)$";
|
||||
|
||||
[StringSyntax("regex")]
|
||||
private const string MajorMinor = @"([0-9]+)\.([0-9]+)";
|
||||
private const string MajorMinor = @"^([0-9]+)\.([0-9]+)$";
|
||||
|
||||
[StringSyntax("regex")]
|
||||
private const string MajorMinorBuild = @"([0-9]+)\.([0-9]+)\.([0-9]+)";
|
||||
private const string MajorMinorBuild = @"^([0-9]+)\.([0-9]+)\.([0-9]+)$";
|
||||
|
||||
[StringSyntax("regex")]
|
||||
private const string Normal = @"([0-9]+)\.([0-9]+)\.([0-9]+)\.?([abcfpx])([0-9]+)((?:.|[\r\n])+)?";
|
||||
private const string Normal = @"^([0-9]+)\.([0-9]+)\.([0-9]+)\.?([abcfpx])([0-9]+)((?:.|[\r\n])+)?$";
|
||||
|
||||
[StringSyntax("regex")]
|
||||
private const string China = @"([0-9]+)\.([0-9]+)\.([0-9]+)\.?f1c([0-9]+)((?:.|[\r\n])+)?";
|
||||
private const string China = @"^([0-9]+)\.([0-9]+)\.([0-9]+)\.?f1c([0-9]+)((?:.|[\r\n])+)?$";
|
||||
|
||||
#if NET7_0_OR_GREATER
|
||||
[GeneratedRegex(Major, Options)]
|
||||
|
||||
Reference in new issue
Block a user