Compare commits

...
4 Commits
Author SHA1 Message Date
ds5678 ca701a43dc Bump version 2024-12-19 13:51:34 -08:00
ds5678 f478cd8015 Make regexes more strict 2024-12-19 13:50:51 -08:00
dependabot[bot] 8cd69e8946 Bump actions/setup-dotnet from 4.0.1 to 4.1.0
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4.0.1 to 4.1.0.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/v4.0.1...v4.1.0)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-12-19 13:32:52 -08:00
dependabot[bot] 3cba893ff2 Bump actions/setup-dotnet from 4.0.0 to 4.0.1
Bumps [actions/setup-dotnet](https://github.com/actions/setup-dotnet) from 4.0.0 to 4.0.1.
- [Release notes](https://github.com/actions/setup-dotnet/releases)
- [Commits](https://github.com/actions/setup-dotnet/compare/v4.0.0...v4.0.1)

---
updated-dependencies:
- dependency-name: actions/setup-dotnet
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-08-06 21:29:50 -07:00
4 changed files with 26 additions and 10 deletions

No files matched your search

+4 -4
View File
@@ -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)]