Skip to content

Commit

Permalink
Merge #2781 Fix ZipValid test on non-English Windows systems
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Jun 12, 2019
2 parents 94489da + 562ed8d commit 4960583
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -26,6 +26,7 @@ All notable changes to this project will be documented in this file.
- [Build] Update packages (#2775 by: Olympic1; reviewed: DasSkelett, HebaruSan)
- [Build] Fix fake/clone tests on Windows (#2778 by: HebaruSan; reviewed: DasSkelett)
- [Reporting] Update issue templates (#2777 by: Olympic1; reviewed: DasSkelett, HebaruSan)
- [Build] Fix ZipValid test on non-English Windows systems (#2781 by: HebaruSan; reviewed: DasSkelett)

## v1.26.2

Expand Down
12 changes: 11 additions & 1 deletion Tests/Core/Cache.cs
@@ -1,8 +1,10 @@
using System;
using System.IO;
using CKAN;
using System.Threading;
using System.Globalization;
using NUnit.Framework;
using Tests.Data;
using CKAN;

namespace Tests.Core
{
Expand Down Expand Up @@ -183,6 +185,11 @@ public void ZipValidation()
[Test]
public void ZipValid_ContainsFilenameWithBadChars_NoException()
{
// We want to inspect a localized error message below.
// Switch to English to ensure it's what we expect.
CultureInfo origUICulture = Thread.CurrentThread.CurrentUICulture;
Thread.CurrentThread.CurrentUICulture = CultureInfo.InvariantCulture;

bool valid = false;
string reason = "";
Assert.DoesNotThrow(() =>
Expand All @@ -194,6 +201,9 @@ public void ZipValid_ContainsFilenameWithBadChars_NoException()
{
Assert.AreEqual(reason, "Illegal characters in path.");
}

// Switch back to the original locale
Thread.CurrentThread.CurrentUICulture = origUICulture;
}

[Test]
Expand Down

0 comments on commit 4960583

Please sign in to comment.