Skip to content

Commit 55a5def

Browse files
Update dependencies (#224)
* Bump xunit.runner.visualstudio from 2.8.2 to 3.0.0 (#218) Bumps [xunit.runner.visualstudio](https://github.com/xunit/visualstudio.xunit) from 2.8.2 to 3.0.0. - [Release notes](https://github.com/xunit/visualstudio.xunit/releases) - [Commits](xunit/visualstudio.xunit@2.8.2...3.0.0) --- updated-dependencies: - dependency-name: xunit.runner.visualstudio dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: AnakinRaW <Anakin@gmx-topmail.de> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * update deps * update desp and package info * update docs and fix GetHashCode not throwing ANE * update dep * update deps and increase to version 7.0.0 * update sln * support case insensitive modinfo.json file lookup for linux * fix secenario number --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent 41631e4 commit 55a5def

26 files changed

Lines changed: 172 additions & 71 deletions

Directory.Build.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<Product>EaW Modinfo</Product>
5-
<Copyright>Copyright © 2024 Alamo Engine Tools and contributors. All rights reserved.</Copyright>
5+
<Copyright>Copyright © 2025 Alamo Engine Tools and contributors. All rights reserved.</Copyright>
66
<Authors>Alamo Engine Tools and Contributors</Authors>
77
<Company>Alamo Engine Tools</Company>
88
<PackageTags>petroglyph, alamo, glyphx, foc, eaw</PackageTags>
@@ -21,7 +21,7 @@
2121
<ItemGroup>
2222
<PackageReference Include="Nerdbank.GitVersioning" Condition="!Exists('packages.config')">
2323
<PrivateAssets>all</PrivateAssets>
24-
<Version>3.7.112</Version>
24+
<Version>3.7.115</Version>
2525
</PackageReference>
2626
<PackageReference Include="SauceControl.InheritDoc" Version="2.0.2" PrivateAssets="all" />
2727
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0">

EawModinfo.sln

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio Version 16
4-
VisualStudioVersion = 16.0.30503.244
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.13.35723.152
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EawModinfo", "src\EawModinfo\EawModinfo.csproj", "{733214FA-5043-46DB-B529-AC83159FA358}"
77
EndProject

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2024 Alamo Engine Tools
3+
Copyright (c) 2025 Alamo Engine Tools
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

src/EawModinfo.Tests/DetectedModReferenceTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
using System;
22
using System.IO.Abstractions;
3-
using System.IO.Abstractions.TestingHelpers;
43
using EawModinfo.Model;
54
using EawModinfo.Spec;
65
using EawModinfo.Utilities;
6+
using Testably.Abstractions.Testing;
77
using Xunit;
88

99
namespace EawModinfo.Tests;

src/EawModinfo.Tests/EawModinfo.Tests.csproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4+
<AssemblyName>AET.Modinfo.Tests</AssemblyName>
45
<TargetFrameworks>net8.0</TargetFrameworks>
56
<TargetFrameworks Condition="!$([MSBuild]::IsOsUnixLike())">$(TargetFrameworks);net48</TargetFrameworks>
67
<IsPackable>false</IsPackable>
@@ -17,14 +18,13 @@
1718
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
1819
</PackageReference>
1920
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.12.0" />
20-
<PackageReference Include="System.IO.Abstractions" Version="21.1.7" />
21-
<PackageReference Include="System.IO.Abstractions.TestingHelpers" Version="21.1.7" />
22-
<PackageReference Include="xunit" Version="2.9.2" />
23-
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
21+
<PackageReference Include="Testably.Abstractions.Testing" Version="4.0.0" />
22+
<PackageReference Include="xunit" Version="2.9.3" />
23+
<PackageReference Include="xunit.runner.visualstudio" Version="3.0.1">
2424
<PrivateAssets>all</PrivateAssets>
2525
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2626
</PackageReference>
27-
<PackageReference Include="coverlet.collector" Version="6.0.2">
27+
<PackageReference Include="coverlet.collector" Version="6.0.4">
2828
<PrivateAssets>all</PrivateAssets>
2929
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3030
</PackageReference>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System;
2+
using EawModinfo.Spec.Equality;
3+
using Xunit;
4+
5+
namespace EawModinfo.Tests;
6+
7+
public class EqualityComparerTest
8+
{
9+
[Fact]
10+
public void Ctor_Null_Args_Throws()
11+
{
12+
Assert.Throws<ArgumentNullException>(() =>
13+
new ModIdentityEqualityComparer(TestUtilities.GetRandomBool(), TestUtilities.GetRandomBool(), null!));
14+
}
15+
16+
[Fact]
17+
public void GetHashCode_NullArg_Throws()
18+
{
19+
Assert.Throws<ArgumentNullException>(() => ModReferenceEqualityComparer.Default.GetHashCode(null!));
20+
21+
Assert.Throws<ArgumentNullException>(() => LanguageInfoEqualityComparer.Default.GetHashCode(null!));
22+
Assert.Throws<ArgumentNullException>(() => LanguageInfoEqualityComparer.WithSupportLevel.GetHashCode(null!));
23+
24+
Assert.Throws<ArgumentNullException>(() => ModDependencyListEqualityComparer.Default.GetHashCode(null!));
25+
26+
Assert.Throws<ArgumentNullException>(() => ModIdentityEqualityComparer.Default.GetHashCode(null!));
27+
Assert.Throws<ArgumentNullException>(() =>
28+
new ModIdentityEqualityComparer(TestUtilities.GetRandomBool(), TestUtilities.GetRandomBool(),
29+
StringComparer.Ordinal).GetHashCode(null!));
30+
}
31+
}

src/EawModinfo.Tests/ModInfoFinderCollectionTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System;
2-
using System.IO.Abstractions.TestingHelpers;
32
using EawModinfo.File;
43
using EawModinfo.Spec;
4+
using Testably.Abstractions.Testing;
55
using Xunit;
66

77
namespace EawModinfo.Tests;

src/EawModinfo.Tests/ModReferenceBuilderTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO.Abstractions;
4-
using System.IO.Abstractions.TestingHelpers;
54
using System.Linq;
65
using EawModinfo.File;
76
using EawModinfo.Model;
87
using EawModinfo.Spec;
98
using EawModinfo.Utilities;
9+
using Testably.Abstractions.Testing;
1010
using Xunit;
1111

1212
namespace EawModinfo.Tests;

src/EawModinfo.Tests/ModinfoFileFinderTests.cs

Lines changed: 63 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4-
using System.IO.Abstractions.TestingHelpers;
54
using System.Linq;
5+
using System.Runtime.InteropServices;
66
using EawModinfo.File;
7+
using Testably.Abstractions.Testing;
78
using Xunit;
89

910
namespace EawModinfo.Tests;
@@ -32,6 +33,10 @@ public ModinfoFileFinderTests()
3233
CreateScenario7_WithInvalidMainModinfo();
3334
CreateScenario8_WithMainModinfoAndInvalidVariant();
3435
CreateScenario9_WithInvalidMainModinfoAndValidVariant();
36+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
37+
{
38+
CreateScenario10_MultipleMainModinfoFiles_Linux();
39+
}
3540
}
3641

3742
[Theory]
@@ -53,6 +58,20 @@ public void FindModinfoFiles_TestAll(int scenario, bool hasMain, int numberVaria
5358
Assert.Equal(numberVariants, result.Variants.Count);
5459
}
5560

61+
[Fact]
62+
public void FindModinfoFiles_CreateScenario10_MultipleMainModinfoFiles_Linux()
63+
{
64+
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
65+
return;
66+
67+
var scenarioPath = _fileSystem.DirectoryInfo.New(_scenarioPaths[10]);
68+
var result = ModinfoFileFinder.FindModinfoFiles(scenarioPath);
69+
70+
Assert.True(result.HasMainModinfoFile);
71+
Assert.Equal("modinfo.json", result.MainModinfo.File.Name);
72+
Assert.Empty(result.Variants);
73+
}
74+
5675
[Theory]
5776
[InlineData(4)]
5877
[InlineData(6)]
@@ -86,8 +105,8 @@ private void CreateScenario1_MainModinfoOnly()
86105
}";
87106
const string fileName = "modinfo.json";
88107
var filePath = _fileSystem.Path.Combine(path, fileName);
89-
90-
_fileSystem.AddFile(filePath, new MockFileData(fileData));
108+
_fileSystem.Directory.CreateDirectory(path);
109+
_fileSystem.File.WriteAllText(filePath, fileData);
91110
return path;
92111
});
93112
}
@@ -102,8 +121,8 @@ private void CreateScenario2_MainModinfoOnly_WithCaseInsensitiveName()
102121
}";
103122
const string fileName = "MoDInfO.json";
104123
var filePath = _fileSystem.Path.Combine(path, fileName);
105-
106-
_fileSystem.AddFile(filePath, new MockFileData(fileData));
124+
_fileSystem.Directory.CreateDirectory(path);
125+
_fileSystem.File.WriteAllText(filePath, fileData);
107126
return path;
108127
});
109128
}
@@ -114,8 +133,10 @@ private void CreateScenario3_WithNoValidModinfoFiles()
114133
{
115134
const string path = "scenario3";
116135

136+
_fileSystem.Directory.CreateDirectory(path);
137+
117138
foreach (var name in TestUtilities.GetInvalidModinfoFileNames())
118-
_fileSystem.AddFile(_fileSystem.Path.Combine(path, name), new MockFileData(string.Empty));
139+
_fileSystem.File.WriteAllText(_fileSystem.Path.Combine(path, name), string.Empty);
119140
return path;
120141
});
121142
}
@@ -138,9 +159,9 @@ private void CreateScenario4_WithMainModinfoAndVariant()
138159
const string variantFileData = @"{
139160
""name"": ""Addon""
140161
}";
141-
142-
_fileSystem.AddFile(mainFilePath, new MockFileData(mainFileData));
143-
_fileSystem.AddFile(variantFilePath, new MockFileData(variantFileData));
162+
_fileSystem.Directory.CreateDirectory(path);
163+
_fileSystem.File.WriteAllText(mainFilePath, mainFileData);
164+
_fileSystem.File.WriteAllText(variantFilePath, variantFileData);
144165

145166
return path;
146167
});
@@ -163,9 +184,9 @@ private void CreateScenario5_WithOnlyVariants()
163184
const string data2 = @"{
164185
""name"": ""Addon-2""
165186
}";
166-
167-
_fileSystem.AddFile(filePath1, new MockFileData(data1));
168-
_fileSystem.AddFile(filePath2, new MockFileData(data2));
187+
_fileSystem.Directory.CreateDirectory(path);
188+
_fileSystem.File.WriteAllText(filePath1, data1);
189+
_fileSystem.File.WriteAllText(filePath2, data2);
169190
return path;
170191
});
171192
}
@@ -188,12 +209,12 @@ private void CreateScenario6_CreateWithMainModinfoAndVariantAndOtherFiles()
188209
const string variantFileData = @"{
189210
""name"": ""Addon""
190211
}";
191-
192-
_fileSystem.AddFile(mainFilePath, new MockFileData(mainFileData));
193-
_fileSystem.AddFile(variantFilePath, new MockFileData(variantFileData));
212+
_fileSystem.Directory.CreateDirectory(path);
213+
_fileSystem.File.WriteAllText(mainFilePath, mainFileData);
214+
_fileSystem.File.WriteAllText(variantFilePath, variantFileData);
194215

195216
foreach (var name in TestUtilities.GetInvalidModinfoFileNames())
196-
_fileSystem.AddFile(_fileSystem.Path.Combine(path, name), new MockFileData(string.Empty));
217+
_fileSystem.File.WriteAllText(_fileSystem.Path.Combine(path, name), string.Empty);
197218

198219
return path;
199220
});
@@ -209,7 +230,8 @@ private void CreateScenario7_WithInvalidMainModinfo()
209230

210231
const string mainFileData = "\0";
211232

212-
_fileSystem.AddFile(mainFilePath, new MockFileData(mainFileData));
233+
_fileSystem.Directory.CreateDirectory(path);
234+
_fileSystem.File.WriteAllText(mainFilePath, mainFileData);
213235

214236
return path;
215237
});
@@ -232,8 +254,9 @@ private void CreateScenario8_WithMainModinfoAndInvalidVariant()
232254

233255
const string variantFileData = "\0";
234256

235-
_fileSystem.AddFile(mainFilePath, new MockFileData(mainFileData));
236-
_fileSystem.AddFile(variantFilePath, new MockFileData(variantFileData));
257+
_fileSystem.Directory.CreateDirectory(path);
258+
_fileSystem.File.WriteAllText(mainFilePath, mainFileData);
259+
_fileSystem.File.WriteAllText(variantFilePath, variantFileData);
237260

238261
return path;
239262
});
@@ -255,9 +278,28 @@ private void CreateScenario9_WithInvalidMainModinfoAndValidVariant()
255278
""name"": ""Addon""
256279
}";
257280

258-
_fileSystem.AddFile(mainFilePath, new MockFileData(mainFileData));
259-
_fileSystem.AddFile(variantFilePath, new MockFileData(variantFileData));
281+
_fileSystem.Directory.CreateDirectory(path);
282+
_fileSystem.File.WriteAllText(mainFilePath, mainFileData);
283+
_fileSystem.File.WriteAllText(variantFilePath, variantFileData);
284+
285+
return path;
286+
});
287+
}
288+
289+
private void CreateScenario10_MultipleMainModinfoFiles_Linux()
290+
{
291+
CreateScenario(10, () =>
292+
{
293+
const string path = "scenario10";
294+
const string fileData = @"{
295+
""name"": ""testmod""
296+
}";
260297

298+
_fileSystem.Directory.CreateDirectory(path);
299+
_fileSystem.File.WriteAllText(_fileSystem.Path.Combine(path, "MoDInfO.json"), fileData);
300+
_fileSystem.File.WriteAllText(_fileSystem.Path.Combine(path, "modinfo.json"), fileData);
301+
_fileSystem.File.WriteAllText(_fileSystem.Path.Combine(path, "modinfo.JSON"), fileData);
302+
_fileSystem.File.WriteAllText(_fileSystem.Path.Combine(path, "MODINFO.json"), fileData);
261303
return path;
262304
});
263305
}

src/EawModinfo.Tests/ModinfoFileTestsBase.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
using System.IO.Abstractions.TestingHelpers;
21
using System.Threading.Tasks;
32
using EawModinfo.Spec;
3+
using Testably.Abstractions.Testing;
44
using Xunit;
55

66
namespace EawModinfo.Tests;

0 commit comments

Comments
 (0)