488 references to AsSpan
Aspire.Dashboard (1)
dotnet-dev-certs (1)
http2cat (5)
IIS.FunctionalTests (5)
IIS.LongTests (5)
IIS.NewHandler.FunctionalTests (5)
IIS.NewShim.FunctionalTests (5)
IISExpress.FunctionalTests (5)
InMemory.FunctionalTests (30)
Microsoft.AspNetCore.Components.Server (2)
src\submodules\MessagePack-CSharp\src\MessagePack.UnityClient\Assets\Scripts\MessagePack\MessagePackWriter.cs (1)
728this.Write(src.AsSpan());
Microsoft.AspNetCore.DataProtection (2)
Microsoft.AspNetCore.DataProtection.Tests (3)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
Microsoft.AspNetCore.Http.Extensions (1)
Microsoft.AspNetCore.Mvc.ApiExplorer (1)
Microsoft.AspNetCore.Mvc.TagHelpers (1)
Microsoft.AspNetCore.OpenApi (1)
Microsoft.AspNetCore.Routing.Tests (8)
Matching\DfaMatcherTest.cs (8)
372var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count));
399var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count));
426var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count));
453var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count));
478var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count));
504var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count));
531var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count));
558var set = matcher.FindCandidateSet(context, path, buffer.AsSpan().Slice(0, count));
Microsoft.AspNetCore.Server.HttpSys.FunctionalTests (5)
Microsoft.AspNetCore.Server.IIS (1)
Microsoft.AspNetCore.Server.Kestrel.Core (1)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (26)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.Shared.Tests (26)
UrlDecoderTests.cs (22)
20int length = UrlDecoder.DecodeRequestLine(input.AsSpan(), destination.AsSpan());
29int length = UrlDecoder.DecodeRequestLine(input.AsSpan(), destination.AsSpan(), false);
30Assert.True(destination.AsSpan(0, length).SequenceEqual(expected.AsSpan()));
39int length = UrlDecoder.DecodeInPlace(destination.AsSpan());
48input.AsSpan().CopyTo(destination);
49int length = UrlDecoder.DecodeInPlace(destination.AsSpan(), false);
50Assert.True(destination.AsSpan(0, length).SequenceEqual(expected.AsSpan()));
57Assert.Throws<ArgumentException>(() => UrlDecoder.DecodeRequestLine(source.AsSpan(), source.AsSpan(0, 1)));
64Assert.Throws<ArgumentException>(() => UrlDecoder.DecodeRequestLine(source.AsSpan(), source.AsSpan(0, 1), false));
71var length = UrlDecoder.DecodeRequestLine(source.AsSpan(), new char[source.Length + 10]);
79var length = UrlDecoder.DecodeRequestLine(source.AsSpan(), new byte[source.Length + 10], false);
87Assert.Throws<InvalidOperationException>(() => UrlDecoder.DecodeInPlace(source.AsSpan()));
94Assert.Throws<InvalidOperationException>(() => UrlDecoder.DecodeInPlace(source.AsSpan(), false));
106var length = UrlDecoder.DecodeInPlace(source.AsSpan());
120var length = UrlDecoder.DecodeInPlace(source.AsSpan(), false);
122Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes(input).AsSpan()));
130var length = UrlDecoder.DecodeInPlace(source.AsSpan(), true);
132Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes("/").AsSpan()));
144var length = UrlDecoder.DecodeInPlace(source.AsSpan());
158var length = UrlDecoder.DecodeInPlace(source.AsSpan(), true);
160Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes(input).AsSpan()));
Microsoft.AspNetCore.SignalR.Common.Tests (2)
Microsoft.AspNetCore.SignalR.Core (1)
Microsoft.AspNetCore.SignalR.Protocols.MessagePack (1)
Microsoft.Build (1)
Microsoft.Build.Tasks.Core (5)
Microsoft.CodeAnalysis (7)
Microsoft.CodeAnalysis.CodeStyle (3)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Microsoft.CodeAnalysis.Test.Utilities (1)
Microsoft.CodeAnalysis.Workspaces (7)
Microsoft.CodeAnalysis.Workspaces.UnitTests (1)
Microsoft.DotNet.Build.Tasks.Installers (7)
Microsoft.DotNet.XUnitAssert.Tests (49)
Sdk\CollectionTrackerTests.cs (9)
80 var span = new[] { 42, 2112 }.AsSpan();
92 var span = new[] { 42, 2112 }.AsSpan();
104 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan();
116 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan();
128 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan();
231 var span = new object[0].AsSpan();
239 var span = new object[0].AsSpan();
251 var span = new object[] { 1, 2.3M, "Hello, world!" }.AsSpan();
263 var span = new object[] { 1, 2.3M, "Hello, world!", 42, 2112, new object() }.AsSpan();
SpanAssertsTests.cs (40)
120 Assert.Contains(new int[] { 3, 4 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan());
126 Assert.Contains(new string[] { "test", "it" }.AsSpan(), new string[] { "something", "interesting", "test", "it", "out" }.AsSpan());
144 var ex = Record.Exception(() => Assert.Contains(new int[] { 13, 14 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan()));
343 Assert.DoesNotContain(new int[] { 13, 14 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan());
349 Assert.DoesNotContain(new string[] { "it", "test" }.AsSpan(), new string[] { "something", "interesting", "test", "it", "out" }.AsSpan());
367 var ex = Record.Exception(() => Assert.DoesNotContain(new int[] { 3, 4 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan()));
715 Assert.Equal(value1.AsSpan(), value2.AsSpan());
716 Assert.Equal(value2.AsSpan(), value1.AsSpan());
719 Assert.Equal(value1.AsSpan(), value2.Spanify());
720 Assert.Equal(value2.AsSpan(), value1.Spanify());
723 Assert.Equal(value1.Spanify(), value2.AsSpan());
724 Assert.Equal(value2.Spanify(), value1.AsSpan());
749 assertFailure(() => Assert.Equal(new int[] { 1, 0, 2, 3 }.AsSpan(), new int[] { 1, 2, 3 }.AsSpan()));
750 assertFailure(() => Assert.Equal(new int[] { 1, 0, 2, 3 }.AsSpan(), new int[] { 1, 2, 3 }.Spanify()));
751 assertFailure(() => Assert.Equal(new int[] { 1, 0, 2, 3 }.Spanify(), new int[] { 1, 2, 3 }.AsSpan()));
772 assertFailure(() => Assert.Equal(new int[] { 1, 2, 3 }.AsSpan(), new int[] { 1, 2, 3, 4 }.AsSpan()));
773 assertFailure(() => Assert.Equal(new int[] { 1, 2, 3 }.AsSpan(), new int[] { 1, 2, 3, 4 }.Spanify()));
774 assertFailure(() => Assert.Equal(new int[] { 1, 2, 3 }.Spanify(), new int[] { 1, 2, 3, 4 }.AsSpan()));
795 Assert.Equal(value1.AsSpan(), value2.AsSpan());
796 Assert.Equal(value2.AsSpan(), value1.AsSpan());
799 Assert.Equal(value1.AsSpan(), value2.Spanify());
800 Assert.Equal(value2.AsSpan(), value1.Spanify());
803 Assert.Equal(value1.Spanify(), value2.AsSpan());
804 Assert.Equal(value2.Spanify(), value1.AsSpan());
828 assertFailure(() => Assert.Equal(new string[] { "yes", "no", "maybe" }.AsSpan(), new string[] { "yes", "no", "maybe", "so" }.AsSpan()));
829 assertFailure(() => Assert.Equal(new string[] { "yes", "no", "maybe" }.AsSpan(), new string[] { "yes", "no", "maybe", "so" }.Spanify()));
830 assertFailure(() => Assert.Equal(new string[] { "yes", "no", "maybe" }.Spanify(), new string[] { "yes", "no", "maybe", "so" }.AsSpan()));
Microsoft.Extensions.AI.Abstractions (1)
Microsoft.Extensions.AI.AzureAIInference (3)
Microsoft.Extensions.Caching.Hybrid.Tests (3)
Microsoft.Extensions.Compliance.Abstractions (3)
Microsoft.Extensions.Compliance.Abstractions.Tests (1)
Microsoft.Extensions.DependencyInjection.Abstractions (3)
Microsoft.Extensions.Diagnostics.ResourceMonitoring (1)
Microsoft.Extensions.FileProviders.Physical (2)
Microsoft.Extensions.Hosting.Systemd (1)
Microsoft.Extensions.Telemetry (2)
Microsoft.ML.Core (9)
Microsoft.ML.DataView (1)
Microsoft.ML.FastTree (16)
Microsoft.ML.ImageAnalytics (1)
Microsoft.ML.StandardTrainers (3)
Microsoft.ML.Tokenizers (26)
PreTokenizer\RegexPreTokenizer.cs (3)
118if (!TryGetMatch(specialTokensRegex, text.AsSpan(), beginning, textLength - beginning, out specialMatch))
123while (TryGetMatch(regex, text.AsSpan(), beginning, specialMatch.Offset - beginning, out match))
134while (TryGetMatch(regex, text.AsSpan(), beginning, textLength - beginning, out match))
Microsoft.ML.Tokenizers.Tests (36)
BpeTests.cs (5)
328status = bpe.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens, out idsConsumed, out charactersWritten);
338status = bpe.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens, out idsConsumed, out charactersWritten);
342Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString());
836Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: true, out int idsConsumed, out int charsWritten));
839Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: false, out idsConsumed, out charsWritten));
CodeGenTests.cs (3)
314status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), hasPrefixSpace, considerSpecialTokens, out idsConsumed, out charactersWritten);
324status = tokenizer.Decode(ids, destinationBuffer.AsSpan(), hasPrefixSpace, considerSpecialTokens, out idsConsumed, out charactersWritten);
328Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString());
LlamaTests.cs (18)
310status = tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten);
320status = tokenizer.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten);
324Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString());
848Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten));
850Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten)));
853Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten));
856Assert.Equal(decodedWithNoSpecialTokens, destinationBuffer.AsSpan().ToString());
862Assert.Equal(OperationStatus.DestinationTooSmall, tokenizer.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens: true, out idsConsumed, out charactersWritten));
864Assert.True(textWithSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten)));
867Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: true, out idsConsumed, out charactersWritten));
870Assert.Equal(textWithSpecialTokens, destinationBuffer.AsSpan().ToString());
887Assert.Equal(OperationStatus.DestinationTooSmall, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), out idsConsumed, out charactersWritten));
889Assert.True(decodedWithNoSpecialTokens.AsSpan().StartsWith(destinationBuffer.AsSpan().Slice(0, charactersWritten)));
892Assert.Equal(OperationStatus.Done, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan(), out idsConsumed, out charactersWritten));
895Assert.Equal(decodedWithNoSpecialTokens, destinationBuffer.AsSpan().Slice(0, charactersWritten).ToString());
901Assert.Equal(OperationStatus.DestinationTooSmall, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens: true, out idsConsumed, out charactersWritten));
903var sp = destinationBuffer.AsSpan().Slice(0, charactersWritten);
911Assert.Equal(OperationStatus.Done, tokenizerWithSuffix.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: true, out idsConsumed, out charactersWritten));
UnigramTests.cs (3)
545Assert.Equal(decodedString, buffer.AsSpan().Slice(0, charsWritten).ToString());
549status = tokenizer.Decode(ids, buffer.AsSpan().Slice(0, i), considerSpecialTokens: false, out idsConsumed, out charsWritten);
551Assert.Equal(decodedString.AsSpan().Slice(0, charsWritten).ToString(), buffer.AsSpan().Slice(0, charsWritten).ToString());
Microsoft.ML.TorchSharp (2)
MSBuild (2)
PresentationCore.Tests (1)
System.Data.Common (2)
System.Data.Odbc (3)
System.Diagnostics.DiagnosticSource (12)
System.Formats.Cbor (3)
System.Formats.Nrbf (6)
System.IO.Compression (1)
System.Net.HttpListener (1)
System.Net.NetworkInformation (2)
System.Net.Security (7)
System.Net.Sockets (3)
System.Net.WebClient (2)
System.Private.CoreLib (11)
System.Private.Windows.Core (2)
System.Private.Xml (1)
System.Reflection.Metadata (5)
System.Resources.Extensions (1)
System.Runtime.Numerics (4)
System.Security.Cryptography (32)
System.Security.Cryptography.Cose (6)
System.Security.Cryptography.Pkcs (9)
System.Security.Cryptography.Xml (3)
System.Text.Json (4)
System.Text.Json.SourceGeneration (1)
System.Text.RegularExpressions (2)
System.Text.RegularExpressions.Generator (1)
System.Windows.Forms (1)
System.Windows.Forms.Design (3)
System.Windows.Forms.Primitives.TestUtilities (4)
Templates.Blazor.Tests (1)
Templates.Blazor.WebAssembly.Auth.Tests (1)
Templates.Blazor.WebAssembly.Tests (1)
Templates.Mvc.Tests (1)
Templates.Tests (1)
Test.Utilities (1)
xunit.assert (3)