< Summary

Line coverage
0%
Covered lines: 0
Uncovered lines: 15
Coverable lines: 15
Total lines: 46
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 2
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity NPath complexity Sequence coverage
ToUpper(...)100%110%
ToLower(...)100%110%
Equal(...)0%220%

File(s)

https://raw.githubusercontent.com/dotnet/runtime/811a7eabb75c42db53440e8ba3f60c07511cfd1f/src/libraries/System.Private.CoreLib/src/System/Globalization/SurrogateCasing.cs

#LineLine coverage
 1// Licensed to the .NET Foundation under one or more agreements.
 2// The .NET Foundation licenses this file to you under the MIT license.
 3
 4using System.Diagnostics;
 5using System.Runtime.CompilerServices;
 6using System.Text;
 7
 8namespace System.Globalization
 9{
 10    internal static class SurrogateCasing
 11    {
 12        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 13        internal static void ToUpper(char h, char l, out char hr, out char lr)
 14        {
 015            Debug.Assert(char.IsHighSurrogate(h));
 016            Debug.Assert(char.IsLowSurrogate(l));
 17
 018            UnicodeUtility.GetUtf16SurrogatesFromSupplementaryPlaneScalar(CharUnicodeInfo.ToUpper(UnicodeUtility.GetScal
 19
 020            Debug.Assert(char.IsHighSurrogate(hr));
 021            Debug.Assert(char.IsLowSurrogate(lr));
 022        }
 23
 24        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 25        internal static void ToLower(char h, char l, out char hr, out char lr)
 26        {
 027            Debug.Assert(char.IsHighSurrogate(h));
 028            Debug.Assert(char.IsLowSurrogate(l));
 29
 030            UnicodeUtility.GetUtf16SurrogatesFromSupplementaryPlaneScalar(CharUnicodeInfo.ToLower(UnicodeUtility.GetScal
 31
 032            Debug.Assert(char.IsHighSurrogate(hr));
 033            Debug.Assert(char.IsLowSurrogate(lr));
 034        }
 35
 36        [MethodImpl(MethodImplOptions.AggressiveInlining)]
 37        internal static bool Equal(char h1, char l1, char h2, char l2)
 38        {
 039            ToUpper(h1, l1, out char hr1, out char lr1);
 040            ToUpper(h2, l2, out char hr2, out char lr2);
 41
 042            return hr1 == hr2 && lr1 == lr2;
 43        }
 44    }
 45}
 46