Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2016 SIL International
# Copyright (c) 2016-2025 SIL Global
# This software is licensed under the MIT license (http://opensource.org/licenses/MIT)

root = true
Expand Down
3 changes: 1 addition & 2 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2013-2022 SIL International
Copyright (c) 2013-2025 SIL Global

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -19,4 +19,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

6 changes: 3 additions & 3 deletions source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
<PackageOutputPath>$(MSBuildThisFileDirectory)\..\output</PackageOutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Company>SIL International</Company>
<Authors>SIL International</Authors>
<Copyright>Copyright © 2007-2024 SIL International</Copyright>
<Company>SIL Global</Company>
<Authors>SIL Global</Authors>
<Copyright>Copyright © 2007-2025 SIL Global</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://github.com/sillsdev/icu-dotnet</PackageProjectUrl>
<AppendToReleaseNotesProperty><![CDATA[
Expand Down
2 changes: 1 addition & 1 deletion source/TestHelper/TestHelper.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2016-2022 SIL International
// Copyright (c) 2016-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using System.IO;
Expand Down
2 changes: 1 addition & 1 deletion source/icu.net.sln
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Global
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0
$0.StandardHeader = $1
$1.Text = @Copyright (c) ${Year} SIL International\nThis software is licensed under the MIT license (http://opensource.org/licenses/MIT)
$1.Text = @Copyright (c) ${Year} SIL Global\nThis software is licensed under the MIT license (http://opensource.org/licenses/MIT)
$1.IncludeInNewFiles = True
StartupItem = icu.net\icu.net.csproj
EndGlobalSection
Expand Down
4 changes: 2 additions & 2 deletions source/icu.net.tests/BreakIteratorTests.Chinese.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2013-2017 SIL International
// Copyright (c) 2013-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using System.Linq;
Expand Down Expand Up @@ -140,7 +140,7 @@ public void CreateSentenceInstanceTest()
new[] { 0, 0, 0, 0 })]
[TestCase(BreakIterator.UBreakIteratorType.WORD,
"你是中国人么? 我喜欢你们的国家。",
new[] { 0, 2, 5, 6, 7, 8, 9, 11, 13, 14, 16, 17 },
new[] { 0, 2, 5, 6, 7, 8, 9, 11, 13, 14, 16, 17 },
new[] { 0, 400, 400, 400, 0, 0, 400, 400, 400, 400, 400, 0 })]
public void CanIterateForwards(BreakIterator.UBreakIteratorType type, string text, int[] expected, BreakIterator.UWordBreak[] ruleStatus)
{
Expand Down
4 changes: 2 additions & 2 deletions source/icu.net.tests/BreakIteratorTests.JDKCompatibility.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) 2016-2017 SIL International
// Copyright (c) 2016-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using NUnit.Framework;
using System;
using NUnit.Framework;

namespace Icu.Tests
{
Expand Down
26 changes: 15 additions & 11 deletions source/icu.net.tests/BreakIteratorTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2013 SIL International
// Copyright (c) 2013-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using System.Collections.Generic;
Expand All @@ -11,10 +11,10 @@ namespace Icu.Tests
[Category("Full ICU")]
public class BreakIteratorTests
{
[TestCase(BreakIterator.UBreakIteratorType.CHARACTER, "abc", ExpectedResult = new[] { "a", "b", "c"})]
[TestCase(BreakIterator.UBreakIteratorType.WORD, "Aa Bb. Cc", ExpectedResult = new[] { "Aa", "Bb", "Cc"})]
[TestCase(BreakIterator.UBreakIteratorType.LINE, "Aa Bb. Cc", ExpectedResult = new[] { "Aa ", "Bb. ", "Cc"})]
[TestCase(BreakIterator.UBreakIteratorType.SENTENCE, "Aa bb. Cc 3.5 x? Y?x! Z", ExpectedResult = new[] { "Aa bb. ", "Cc 3.5 x? ", "Y?", "x! ", "Z"})]
[TestCase(BreakIterator.UBreakIteratorType.CHARACTER, "abc", ExpectedResult = new[] { "a", "b", "c" })]
[TestCase(BreakIterator.UBreakIteratorType.WORD, "Aa Bb. Cc", ExpectedResult = new[] { "Aa", "Bb", "Cc" })]
[TestCase(BreakIterator.UBreakIteratorType.LINE, "Aa Bb. Cc", ExpectedResult = new[] { "Aa ", "Bb. ", "Cc" })]
[TestCase(BreakIterator.UBreakIteratorType.SENTENCE, "Aa bb. Cc 3.5 x? Y?x! Z", ExpectedResult = new[] { "Aa bb. ", "Cc 3.5 x? ", "Y?", "x! ", "Z" })]
public IEnumerable<string> Split(BreakIterator.UBreakIteratorType type, string text)
{
return BreakIterator.Split(type, "en-US", text);
Expand Down Expand Up @@ -102,7 +102,7 @@ public void GetWordBoundaries_IncludeSpacesAndPunctuation()
}

/// <summary>
/// The hypenated text case tests the difference between Word and Line
/// The hyphenated text case tests the difference between Word and Line
/// breaks described in:
/// http://userguide.icu-project.org/boundaryanalysis#TOC-Line-break-Boundary
/// </summary>
Expand All @@ -128,7 +128,7 @@ public void GetWordAndLineBoundariesWithHyphenatedText()
}

[Test]
public void CreateChracterInstanceTest()
public void CreateCharacterInstanceTest()
{
var locale = new Locale("de-DE");
var text = "Good-bye, dear!";
Expand Down Expand Up @@ -647,10 +647,14 @@ public void Clone()
}
}

[TestCase(BreakIterator.UBreakIteratorType.CHARACTER, ExpectedResult = new[] { "A","a"," ","b","b","."," ","C","c"," ","3",".","5"," ","x","?"," ","Y","?","x","!"," ","Z"})]
[TestCase(BreakIterator.UBreakIteratorType.WORD, ExpectedResult = new[] { "Aa"," ","bb","."," ","Cc"," ","3.5"," ","x","?"," ","Y","?","x","!"," ","Z"})]
[TestCase(BreakIterator.UBreakIteratorType.LINE, ExpectedResult = new[] { "Aa ", "bb. ", "Cc ", "3.5 ", "x? ", "Y?", "x! ", "Z"})]
[TestCase(BreakIterator.UBreakIteratorType.SENTENCE, ExpectedResult = new[] { "Aa bb. ", "Cc 3.5 x? ", "Y?", "x! ", "Z"})]
[TestCase(BreakIterator.UBreakIteratorType.CHARACTER,
ExpectedResult = new[] { "A", "a", " ", "b", "b", ".", " ", "C", "c", " ", "3", ".", "5", " ", "x", "?", " ", "Y", "?", "x", "!", " ", "Z" })]
[TestCase(BreakIterator.UBreakIteratorType.WORD,
ExpectedResult = new[] { "Aa", " ", "bb", ".", " ", "Cc", " ", "3.5", " ", "x", "?", " ", "Y", "?", "x", "!", " ", "Z" })]
[TestCase(BreakIterator.UBreakIteratorType.LINE,
ExpectedResult = new[] { "Aa ", "bb. ", "Cc ", "3.5 ", "x? ", "Y?", "x! ", "Z" })]
[TestCase(BreakIterator.UBreakIteratorType.SENTENCE,
ExpectedResult = new[] { "Aa bb. ", "Cc 3.5 x? ", "Y?", "x! ", "Z" })]
public List<string> GetEnumerator(BreakIterator.UBreakIteratorType type)
{
using (var breakIterator = new RuleBasedBreakIterator(type, "en-US"))
Expand Down
5 changes: 2 additions & 3 deletions source/icu.net.tests/CharacterTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) 2013 SIL International
// Copyright (c) 2013-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using NUnit.Framework;
using System.Globalization;
using NUnit.Framework;

namespace Icu.Tests
{
Expand Down
14 changes: 7 additions & 7 deletions source/icu.net.tests/Collation/CollatorTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2013 SIL International
// Copyright (c) 2013-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using System.Globalization;
Expand Down Expand Up @@ -73,7 +73,7 @@ public void Create_nonexistent_throws()
}

[Test]
public void Create_nonexistentFallbackAllowed_fallsbackToUca()
public void Create_nonexistentFallbackAllowed_fallsBackToUca()
{
using (var collator = Collator.Create("non-existent", Collator.Fallback.FallbackAllowed))
{
Expand All @@ -100,7 +100,7 @@ public void Create_NoPredefinedCollator_Throws()
{
Assert.That(() =>
{
using (Collator.Create("my-MM")) {}
using (Collator.Create("my-MM")) { }
}, Throws.ArgumentException);
}

Expand All @@ -111,7 +111,7 @@ public void Create_NoPredefinedCollator_NoFallback_Throws()
{
Assert.That(() =>
{
using (Collator.Create("my-MM", Collator.Fallback.NoFallback)) {}
using (Collator.Create("my-MM", Collator.Fallback.NoFallback)) { }
},
Throws.ArgumentException);
}
Expand All @@ -123,7 +123,7 @@ public void Create_NoPredefinedCollator_FallbackAllowed_Works()
{
Assert.That(() =>
{
using (Collator.Create("my-MM", Collator.Fallback.FallbackAllowed)) {}
using (Collator.Create("my-MM", Collator.Fallback.FallbackAllowed)) { }
},
Throws.Nothing);
}
Expand All @@ -135,7 +135,7 @@ public void Create_PredefinedCollator_Works()
{
Assert.That(() =>
{
using (Collator.Create("my")) {}
using (Collator.Create("my")) { }
},
Throws.Nothing);
}
Expand All @@ -147,7 +147,7 @@ public void Create_PredefinedCollator_NoFallback_Works()
{
Assert.That(() =>
{
using (Collator.Create("my", Collator.Fallback.NoFallback)) {}
using (Collator.Create("my", Collator.Fallback.NoFallback)) { }
},
Throws.Nothing);
}
Expand Down
8 changes: 4 additions & 4 deletions source/icu.net.tests/Collation/RuleBasedCollatorTests.cs

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions source/icu.net.tests/Collation/SortKeyTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2013 SIL International
// Copyright (c) 2013-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using System.Globalization;
Expand All @@ -23,37 +23,37 @@ public void SortKey_nullKeyData_Throws()
[Test]
public void SortKey_KeyDataLengthTooLarge_Throws()
{
byte[] keyData = new byte[] { 0xae, 0x1,0x20,0x1};
byte[] keyData = new byte[] { 0xae, 0x1, 0x20, 0x1 };
Assert.Throws<ArgumentOutOfRangeException>(() => Collator.CreateSortKey("hello", keyData, keyData.Length + 1));
}

[Test]
public void SortKey_KeyDataLengthNegative_Throws()
{
byte[] keyData = new byte[] { 0xae, 0x1, 0x20,0x1 };
byte[] keyData = new byte[] { 0xae, 0x1, 0x20, 0x1 };
Assert.Throws<ArgumentOutOfRangeException>(() => Collator.CreateSortKey("hello", keyData, -1));
}

[Test]
public void SortKey_nullOriginalString_Throws()
{
byte[] keyData = new byte[] { 0xae, 0x1, 0x20,0x1 };
byte[] keyData = new byte[] { 0xae, 0x1, 0x20, 0x1 };
Assert.Throws<ArgumentNullException>(() => Collator.CreateSortKey(null, keyData));
}

[Test]
public void ConstructSortKey()
{
byte[] keyData = new byte[] { 0xae, 0x1, 0x20,0x1 };
byte[] keyData = new byte[] { 0xae, 0x1, 0x20, 0x1 };
Assert.IsNotNull(Collator.CreateSortKey("iou", keyData));
}

[Test]
public void Compare_keyDataChanges_NotAffected()
{
byte[] keyData = new byte[] { 0xae, 0x1, 0x20,0x1 };
byte[] keyData = new byte[] { 0xae, 0x1, 0x20, 0x1 };
SortKey sortKey1 = Collator.CreateSortKey("heo", keyData);
keyData = new byte[] { 0xae, 0x1, 0x21,0x1 };
keyData = new byte[] { 0xae, 0x1, 0x21, 0x1 };
SortKey sortKey2 = Collator.CreateSortKey("heol", keyData);
Assert.AreEqual(Precedes, SortKey.Compare(sortKey1, sortKey2));
}
Expand Down Expand Up @@ -102,7 +102,7 @@ public void Compare_keyDataSame_same()
[Test]
public void Compare_SamePrefixSecondLonger_precedes()
{
byte[] keyData1 = new byte[] { 0xae, 0x1, 0x20,0x1 };
byte[] keyData1 = new byte[] { 0xae, 0x1, 0x20, 0x1 };
SortKey sortKey1 = Collator.CreateSortKey("heo", keyData1);
byte[] keyData2 = new byte[] { 0xae, 0x1, 0x20, 0x32, 0x1 };
SortKey sortKey2 = Collator.CreateSortKey("heol", keyData2);
Expand Down
3 changes: 1 addition & 2 deletions source/icu.net.tests/IcuWrapperTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2013-2022 SIL International
// Copyright (c) 2013-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)

using System;
using System.Diagnostics;
using System.IO;
Expand Down
6 changes: 2 additions & 4 deletions source/icu.net.tests/LocaleTests.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
// Copyright (c) 2013 SIL International
// Copyright (c) 2013-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using NUnit.Framework;
using Icu;
using System.Globalization;
using NUnit.Framework;

namespace Icu.Tests
{
Expand Down
3 changes: 1 addition & 2 deletions source/icu.net.tests/MessageFormatterTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2018 SIL International
// Copyright (c) 2018-2025 SIL Global
// This software is licensed under the MIT License (http://opensource.org/licenses/MIT)

using NUnit.Framework;

namespace Icu.Tests
Expand Down
3 changes: 1 addition & 2 deletions source/icu.net.tests/NativeMethods/DllResolverTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2022 SIL International
// Copyright (c) 2022-2025 SIL Global
// This software is licensed under the MIT License (http://opensource.org/licenses/MIT)

using System.IO;
using NUnit.Framework;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright (c) 2018 SIL International
// Copyright (c) 2018-2025 SIL Global
// This software is licensed under the MIT License (http://opensource.org/licenses/MIT)

using System;
using System.IO;
using System.Reflection;
using NUnit.Framework;
Expand All @@ -25,7 +23,7 @@ private int CallGetIcuVersionInfoForNetCoreOrWindows()
var result = method?.Invoke(null, null);
var icuVersionInfoType = icunetAssembly.GetType("Icu.IcuVersionInfo");
var icuVersionFieldInfo = icuVersionInfoType.GetField("IcuVersion");
return (int) icuVersionFieldInfo.GetValue(result);
return (int)icuVersionFieldInfo.GetValue(result);
}

[SetUp]
Expand Down
12 changes: 6 additions & 6 deletions source/icu.net.tests/NativeMethods/NativeMethodsTests.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) 2016-2022 SIL International
// Copyright (c) 2016-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using System.Diagnostics;
Expand All @@ -13,12 +13,12 @@ namespace Icu.Tests
[TestFixture]
public class NativeMethodsTests
{
private string _tmpDir;
private string _pathEnvironmentVariable;
public const string FullIcuLibraryVersion = "62.1";
private string _tmpDir;
private string _pathEnvironmentVariable;
public const string FullIcuLibraryVersion = "62.1";
public const string FullIcuLibraryVersionMajor = "62";
public const string MinIcuLibraryVersion = "59.1";
public const string MinIcuLibraryVersionMajor = "59";
public const string MinIcuLibraryVersion = "59.1";
public const string MinIcuLibraryVersionMajor = "59";

internal static int MaxInstalledIcuLibraryVersion
{
Expand Down
3 changes: 1 addition & 2 deletions source/icu.net.tests/Normalization/Normalizer2Tests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2018-2021 SIL International
// Copyright (c) 2018-2025 SIL Global
// This software is licensed under the MIT License (http://opensource.org/licenses/MIT)

using Icu.Normalization;
using NUnit.Framework;

Expand Down
5 changes: 1 addition & 4 deletions source/icu.net.tests/Normalization/NormalizerTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Copyright (c) 2013 SIL International
// Copyright (c) 2013-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)
using System;
using System.Text;
using Icu.Normalization;
using NUnit.Framework;

namespace Icu.Tests
Expand Down
9 changes: 3 additions & 6 deletions source/icu.net.tests/ResourceBundleTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// Copyright (c) 2018 SIL International
// Copyright (c) 2018-2025 SIL Global
// This software is licensed under the MIT License (http://opensource.org/licenses/MIT)

using System;
using System.Collections.Generic;
using NUnit.Framework;

namespace Icu.Tests
Expand Down Expand Up @@ -34,7 +31,7 @@ public void GetStringContents()
using (var resourceBundle = new ResourceBundle("ICUDATA-translit", "en_US"))
{
Assert.That(resourceBundle.GetStringContents(),
Is.EquivalentTo(new [] { "Hex Escape", "Unicode Character", "Unicode Name", "{0,choice,0#|1#{1}|2#{1} to {2}}" }));
Is.EquivalentTo(new[] { "Hex Escape", "Unicode Character", "Unicode Name", "{0,choice,0#|1#{1}|2#{1} to {2}}" }));
}
}

Expand All @@ -43,7 +40,7 @@ public void GetStringContentsWithKeys()
{
using (var resourceBundle = new ResourceBundle("ICUDATA-translit", "en_US"))
{
Assert.That(resourceBundle.GetStringContentsWithKeys(), Is.EquivalentTo(new [] {
Assert.That(resourceBundle.GetStringContentsWithKeys(), Is.EquivalentTo(new[] {
("%Translit%Hex", "Hex Escape"),
("%Translit%UnicodeChar", "Unicode Character"),
("%Translit%UnicodeName", "Unicode Name"),
Expand Down
4 changes: 1 addition & 3 deletions source/icu.net.tests/SetUpFixture.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
// Copyright (c) 2017-2022 SIL International
// Copyright (c) 2017-2025 SIL Global
// This software is licensed under the MIT license (http://opensource.org/licenses/MIT)

using System;
using System.Runtime.InteropServices;
using NUnit.Framework;

Expand All @@ -18,7 +16,7 @@

#if NETFRAMEWORK
// See http://www.mono-project.com/docs/faq/technical/#how-to-detect-the-execution-platform
switch ((int)Environment.OSVersion.Platform)

Check failure on line 19 in source/icu.net.tests/SetUpFixture.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

The name 'Environment' does not exist in the current context

Check failure on line 19 in source/icu.net.tests/SetUpFixture.cs

View workflow job for this annotation

GitHub Actions / Build and Test (ubuntu-latest)

The name 'Environment' does not exist in the current context
{
case 4:
case 128:
Expand Down
Loading
Loading