-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change all public types in namespace Cysharp.Text to internal (#372)
* Change all public types in namespace Cysharp.Text to internal * Regression caused by #368 * Stop namespace collision with Cysharp.Text nuget package * Affects: class, struct, interface, delegate, enum * using https://github.com/zzzprojects/findandreplace on command line, so we can automate this step: "fnr.exe" --cl --dir "SmartFormat.ZString\repo\src\ZString" --fileMask "*.cs,*.tt" --includeSubDirectories --caseSensitive --useRegEx --find "public (?=.*(class |struct |enum |interface |delegate ))" --replace "internal " * Add a unit test to get an alert when Cysharp.Text objects are public * Bump version to v3.3.2
- Loading branch information
Showing
43 changed files
with
176 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// Copyright SmartFormat Project maintainers and contributors. | ||
// Licensed under the MIT license. | ||
// | ||
|
||
using NUnit.Framework; | ||
|
||
namespace SmartFormat.ZString.Tests; | ||
|
||
[TestFixture] | ||
public class CysharpText | ||
{ | ||
/// <summary> | ||
/// To stop namespace collision with Cysharp.Text nuget package, | ||
/// change all public types in namespace Cysharp.Text to internal. | ||
/// This can easily happen when Cysharp.Text is updated in the SmartFormat.ZString project. | ||
/// Using https://github.com/zzzprojects/findandreplace on command line, so we can automate this step: | ||
/// "fnr.exe" --cl --dir "SmartFormat.ZString\repo\src\ZString" --fileMask "*.cs,*.tt" --includeSubDirectories --caseSensitive --useRegEx --find "public (?=.*(class |struct |enum |interface |delegate ))" --replace "internal " | ||
/// </summary> | ||
[Test] | ||
public void Classes_Of_Cysharp_Text_Namespace_Should_Be_Internal() | ||
{ | ||
// If this tests fails, you need to run the above command line | ||
// to change all public types in namespace Cysharp.Text to internal | ||
Assert.Multiple(() => | ||
{ | ||
Assert.That(typeof(Cysharp.Text.Utf16ValueStringBuilder).IsPublic, Is.False); | ||
Assert.That(typeof(Cysharp.Text.Utf8ValueStringBuilder).IsPublic, Is.False); | ||
Assert.That(typeof(Cysharp.Text.ZString).IsPublic, Is.False); | ||
Assert.That(typeof(Cysharp.Text.FormatParser).IsPublic, Is.False); | ||
Assert.That(typeof(System.HexConverter).IsPublic, Is.False); | ||
}); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
src/SmartFormat.ZString.Tests/SmartFormat.ZString.Tests.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<Description>Unit tests for SmartFormat.ZString</Description> | ||
<AssemblyTitle>SmartFormat.ZString.Tests</AssemblyTitle> | ||
<Authors>axuno gGmbH, Scott Rippey, Bernhard Millauer and other contributors.</Authors> | ||
<TargetFrameworks>net462;net6.0</TargetFrameworks> | ||
<DefineConstants>TRACE;DEBUG;RELEASE</DefineConstants> | ||
<GenerateDocumentationFile>false</GenerateDocumentationFile> | ||
<AssemblyName>SmartFormat.ZString.Tests</AssemblyName> | ||
<AssemblyOriginatorKeyFile>../SmartFormat/SmartFormat.snk</AssemblyOriginatorKeyFile> | ||
<DelaySign>false</DelaySign> | ||
<SignAssembly>true</SignAssembly> | ||
<IsPackable>false</IsPackable> | ||
<Nullable>enable</Nullable> | ||
<NeutralLanguage>en</NeutralLanguage> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> | ||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.8.0" /> | ||
<PackageReference Include="NUnit" Version="4.0.1" /> | ||
<PackageReference Include="NUnit.Analyzers" Version="3.10.0"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" /> | ||
<PackageReference Include="FluentAssertions" Version="6.12.0" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'"> | ||
<NoWarn>$(NoWarn);CA1861</NoWarn> | ||
<WarningLevel>4</WarningLevel> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> | ||
<NoWarn>$(NoWarn);CA1861</NoWarn> | ||
<WarningLevel>4</WarningLevel> | ||
<DefineConstants>RELEASE</DefineConstants> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\SmartFormat.ZString\SmartFormat.ZString.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.