Skip to content

Commit

Permalink
Update sdk version (#8)
Browse files Browse the repository at this point in the history
* Update .net SDK version to 8.0.100

This can allow more recent language features, at least in the test project

* Update utf-7 reliant tests to utf-8

Utf-7 was depricated with .NET 5.
Winforms also updated their tests, links below.

https://github.com/dotnet/winforms/blob/ab66fbd11b8bf029da5031cae891dada08bbd56b/src/System.Windows.Forms/tests/UnitTests/System/Resources/ResXFileRef.ConverterTests.cs#L62

https://github.com/dotnet/winforms/blob/ab66fbd11b8bf029da5031cae891dada08bbd56b/src/System.Windows.Forms/tests/UnitTests/TestResources/Files/text.utf8.txt#L1C4-L1C4

* Fix them slashes for cross-platform
  • Loading branch information
farlee2121 authored Dec 6, 2023
1 parent 94eb14f commit 110c7e0
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 3.1.101
dotnet-version: 8.0.100
- name: Install dependencies
run: dotnet restore
- name: Build
Expand Down
1 change: 1 addition & 0 deletions System.Resources.NetStandard.sln
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.Resources.NetStandar
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{22B0DAA0-D080-4A95-99F2-6EDC8F0D5E7B}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build.yml = .github\workflows\build.yml
Directory.Build.props = Directory.Build.props
EndProjectSection
EndProject
Expand Down
3 changes: 2 additions & 1 deletion Tests/ResXFileRef.ConverterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,12 @@ public void ConvertFrom_ReadsFileAsString()

Assert.Equal(expected, result);
}


[Fact]
public void ConvertFrom_ReadsFileAsStringUsingEncodingFromRefString()
{
var resxFileRefString = @"TestResources/Files/text.utf7.txt;System.String;utf-7";
var resxFileRefString = @"TestResources/Files/text.utf8.txt;System.String;utf-8";
var expected = "Привет";
var converter = new ResXFileRef.Converter();

Expand Down
5 changes: 3 additions & 2 deletions Tests/System.Resources.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net8</TargetFramework>

<IsPackable>false</IsPackable>
</PropertyGroup>
Expand All @@ -18,6 +18,7 @@
<PackageReference Include="System.Drawing.Common" Version="4.7.2" />
<PackageReference Include="Xunit.SkippableFact" Version="1.4.13" />
<PackageReference Include="System.Resources.Extensions" Version="7.0.0" />
<PackageReference Include="System.Text.Encoding.Extensions" Version="4.3.0" />
</ItemGroup>
<ItemGroup>
<Content Include="TestResources\**">
Expand Down
1 change: 0 additions & 1 deletion Tests/TestResources/Files/text.utf7.txt

This file was deleted.

1 change: 1 addition & 0 deletions Tests/TestResources/Files/text.utf8.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Привет

0 comments on commit 110c7e0

Please sign in to comment.