From 110c7e08ac83c90d6b207e8825d66fa9d9974f32 Mon Sep 17 00:00:00 2001 From: Spencer Farley <2847259+farlee2121@users.noreply.github.com> Date: Tue, 5 Dec 2023 17:11:39 -0700 Subject: [PATCH] Update sdk version (#8) * 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 --- .github/workflows/build.yml | 2 +- System.Resources.NetStandard.sln | 1 + Tests/ResXFileRef.ConverterTests.cs | 3 ++- Tests/System.Resources.Tests.csproj | 5 +++-- Tests/TestResources/Files/text.utf7.txt | 1 - Tests/TestResources/Files/text.utf8.txt | 1 + 6 files changed, 8 insertions(+), 5 deletions(-) delete mode 100644 Tests/TestResources/Files/text.utf7.txt create mode 100644 Tests/TestResources/Files/text.utf8.txt diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4716cdb..6a3fd56 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 diff --git a/System.Resources.NetStandard.sln b/System.Resources.NetStandard.sln index e6272c5..cd72121 100644 --- a/System.Resources.NetStandard.sln +++ b/System.Resources.NetStandard.sln @@ -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 diff --git a/Tests/ResXFileRef.ConverterTests.cs b/Tests/ResXFileRef.ConverterTests.cs index c07b6e4..90270e5 100644 --- a/Tests/ResXFileRef.ConverterTests.cs +++ b/Tests/ResXFileRef.ConverterTests.cs @@ -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(); diff --git a/Tests/System.Resources.Tests.csproj b/Tests/System.Resources.Tests.csproj index 854ad7f..09d3baf 100644 --- a/Tests/System.Resources.Tests.csproj +++ b/Tests/System.Resources.Tests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp3.1 + net8 false @@ -18,6 +18,7 @@ + diff --git a/Tests/TestResources/Files/text.utf7.txt b/Tests/TestResources/Files/text.utf7.txt deleted file mode 100644 index 31befc8..0000000 --- a/Tests/TestResources/Files/text.utf7.txt +++ /dev/null @@ -1 +0,0 @@ -+BB8EQAQ4BDIENQRC- \ No newline at end of file diff --git a/Tests/TestResources/Files/text.utf8.txt b/Tests/TestResources/Files/text.utf8.txt new file mode 100644 index 0000000..1d122a1 --- /dev/null +++ b/Tests/TestResources/Files/text.utf8.txt @@ -0,0 +1 @@ +Привет \ No newline at end of file