< Summary

Line coverage
100%
Covered lines: 22
Uncovered lines: 0
Coverable lines: 22
Total lines: 102
Line coverage: 100%
Branch coverage
100%
Covered branches: 6
Total branches: 6
Branch coverage: 100%
Method coverage
100%
Covered methods: 5
Fully covered methods: 5
Total methods: 5
Method coverage: 100%
Full method coverage: 100%

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.cctor()100%11100%
.ctor()100%11100%
CreateInstance()100%11100%
Scan(...)100%22100%
TryFindNextPossibleStartingPosition(...)100%44100%

File(s)

/home/runner/work/dotnet-validation/dotnet-validation/src/obj/Release/net10.0/generated/System.Text.RegularExpressions.Generator/System.Text.RegularExpressions.Generator.RegexGenerator/RegexGenerator.g.cs

#LineLine coverage
 1// <auto-generated/>
 2#nullable enable
 3#pragma warning disable
 4
 5namespace ArturRios.Validation
 6{
 7    partial class FluentValidator<T>
 8    {
 9        /// <remarks>
 10        /// Pattern:<br/>
 11        /// <code>['.]</code><br/>
 12        /// Explanation:<br/>
 13        /// <code>
 14        /// ○ Match a character in the set ['.].<br/>
 15        /// </code>
 16        /// </remarks>
 17        [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "10.0.14.374
 18        private static partial global::System.Text.RegularExpressions.Regex SpecialChars() => global::System.Text.Regula
 19    }
 20}
 21
 22namespace System.Text.RegularExpressions.Generated
 23{
 24    using System;
 25    using System.Buffers;
 26    using System.CodeDom.Compiler;
 27    using System.Collections;
 28    using System.ComponentModel;
 29    using System.Globalization;
 30    using System.Runtime.CompilerServices;
 31    using System.Text.RegularExpressions;
 32    using System.Threading;
 33
 34    /// <summary>Custom <see cref="Regex"/>-derived type for the SpecialChars method.</summary>
 35    [GeneratedCodeAttribute("System.Text.RegularExpressions.Generator", "10.0.14.37416")]
 36    file sealed class SpecialChars_0 : Regex
 37    {
 38        /// <summary>Cached, thread-safe singleton instance.</summary>
 139        internal static readonly SpecialChars_0 Instance = new();
 40
 41        /// <summary>Initializes the instance.</summary>
 142        private SpecialChars_0()
 43        {
 144            base.pattern = "['.]";
 145            base.roptions = RegexOptions.None;
 146            base.internalMatchTimeout = TimeSpan.FromMilliseconds(100);
 147            base.factory = new RunnerFactory();
 148            base.capsize = 1;
 149        }
 50
 51        /// <summary>Provides a factory for creating <see cref="RegexRunner"/> instances to be used by methods on <see c
 52        private sealed class RunnerFactory : RegexRunnerFactory
 53        {
 54            /// <summary>Creates an instance of a <see cref="RegexRunner"/> used by methods on <see cref="Regex"/>.</sum
 155            protected override RegexRunner CreateInstance() => new Runner();
 56
 57            /// <summary>Provides the runner that contains the custom logic implementing the specified regular expressio
 58            private sealed class Runner : RegexRunner
 59            {
 60                /// <summary>Scan the <paramref name="inputSpan"/> starting from base.runtextstart for the next match.</
 61                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
 62                protected override void Scan(ReadOnlySpan<char> inputSpan)
 63                {
 5464                    if (TryFindNextPossibleStartingPosition(inputSpan))
 65                    {
 66                        // The search in TryFindNextPossibleStartingPosition performed the entire match.
 4367                        int start = base.runtextpos;
 4368                        int end = base.runtextpos = start + 1;
 4369                        base.Capture(0, start, end);
 70                    }
 5471                }
 72
 73                /// <summary>Search <paramref name="inputSpan"/> starting from base.runtextpos for the next location a m
 74                /// <param name="inputSpan">The text being scanned by the regular expression.</param>
 75                /// <returns>true if a possible match was found; false if no more matches are possible.</returns>
 76                private bool TryFindNextPossibleStartingPosition(ReadOnlySpan<char> inputSpan)
 77                {
 5478                    int pos = base.runtextpos;
 79
 80                    // Empty matches aren't possible.
 5481                    if ((uint)pos < (uint)inputSpan.Length)
 82                    {
 83                        // The pattern begins with a character in the set ['.].
 84                        // Find the next occurrence. If it can't be found, there's no match.
 4385                        int i = inputSpan.Slice(pos).IndexOfAny('\'', '.');
 4386                        if (i >= 0)
 87                        {
 4388                            base.runtextpos = pos + i;
 4389                            return true;
 90                        }
 91                    }
 92
 93                    // No match found.
 1194                    base.runtextpos = inputSpan.Length;
 1195                    return false;
 96                }
 97            }
 98        }
 99
 100    }
 101
 102}