Exemplo n.º 1
0
        [InlineData('\u0080', '\u0080' + 32)] // Outside of ASCII range
        public void AsciiIgnoreCaseEquals_ReturnsFalse(char x, char y)
        {
            // Arrange

            // Act
            var result = Ascii.AsciiIgnoreCaseEquals(x, y);

            // Assert
            Assert.False(result);
        }
Exemplo n.º 2
0
        public void UnsafeAsciiIgnoreCaseEquals_ReturnsTrue(string x, string y, int length)
        {
            // Arrange
            var spanX = x.AsSpan();
            var spanY = y.AsSpan();

            // Act
            var result = Ascii.AsciiIgnoreCaseEquals(spanX, spanY, length);

            // Assert
            Assert.True(result);
        }
        public unsafe override int GetDestination(string path, PathSegment segment)
        {
            var length = segment.Length;

            if (length == 0)
            {
                return(_exitDestination);
            }

            var text = _text;

            if (length != text.Length)
            {
                return(_defaultDestination);
            }

            var a = path.AsSpan(segment.Start, length);
            var b = text.AsSpan();

            return(Ascii.AsciiIgnoreCaseEquals(a, b, length) ? _destination : _defaultDestination);
        }