618 references to AsSpan
aspire (1)
Aspire.Dashboard (1)
Aspire.Hosting (1)
Aspire.Hosting.Tests (11)
Dcp\DcpLogParserTests.cs (11)
21var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category);
38var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category);
55var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category);
72var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category);
89var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category);
106var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out _);
122var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out _);
138var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out _, out _, out _);
152var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out _, out _, out _);
211var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category);
233var result = DcpLogParser.TryParseDcpLog(bytes.AsSpan(), out var message, out var logLevel, out var category);
dotnet-dev-certs (1)
GenerateDocumentationAndConfigFiles (4)
http2cat (5)
IIS.FunctionalTests (5)
IIS.LongTests (5)
IIS.NewHandler.FunctionalTests (5)
IISExpress.FunctionalTests (5)
ILLink.RoslynAnalyzer (1)
InMemory.FunctionalTests (30)
Metrics (4)
Metrics.Legacy (4)
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 (1)
Microsoft.AspNetCore.DataProtection.Tests (5)
Microsoft.AspNetCore.DeveloperCertificates.XPlat (1)
Microsoft.AspNetCore.Http.Extensions (1)
Microsoft.AspNetCore.Identity (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 (2)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (28)
Microsoft.AspNetCore.Server.Kestrel.Microbenchmarks (2)
Microsoft.AspNetCore.Shared.Tests (28)
UrlDecoderTests.cs (22)
16int length = UrlDecoder.DecodeRequestLine(input.AsSpan(), destination.AsSpan());
25int length = UrlDecoder.DecodeRequestLine(input.AsSpan(), destination.AsSpan(), false);
26Assert.True(destination.AsSpan(0, length).SequenceEqual(expected.AsSpan()));
35int length = UrlDecoder.DecodeInPlace(destination.AsSpan());
44input.AsSpan().CopyTo(destination);
45int length = UrlDecoder.DecodeInPlace(destination.AsSpan(), false);
46Assert.True(destination.AsSpan(0, length).SequenceEqual(expected.AsSpan()));
53Assert.Throws<ArgumentException>(() => UrlDecoder.DecodeRequestLine(source.AsSpan(), source.AsSpan(0, 1)));
60Assert.Throws<ArgumentException>(() => UrlDecoder.DecodeRequestLine(source.AsSpan(), source.AsSpan(0, 1), false));
67var length = UrlDecoder.DecodeRequestLine(source.AsSpan(), new char[source.Length + 10]);
75var length = UrlDecoder.DecodeRequestLine(source.AsSpan(), new byte[source.Length + 10], false);
83Assert.Throws<InvalidOperationException>(() => UrlDecoder.DecodeInPlace(source.AsSpan()));
90Assert.Throws<InvalidOperationException>(() => UrlDecoder.DecodeInPlace(source.AsSpan(), false));
102var length = UrlDecoder.DecodeInPlace(source.AsSpan());
116var length = UrlDecoder.DecodeInPlace(source.AsSpan(), false);
118Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes(input).AsSpan()));
126var length = UrlDecoder.DecodeInPlace(source.AsSpan(), true);
128Assert.True(source.AsSpan(0, length).SequenceEqual(Encoding.UTF8.GetBytes("/").AsSpan()));
140var length = UrlDecoder.DecodeInPlace(source.AsSpan());
154var length = UrlDecoder.DecodeInPlace(source.AsSpan(), true);
156Assert.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.CodeAnalysis (8)
Microsoft.CodeAnalysis.Analyzers (4)
Microsoft.CodeAnalysis.AnalyzerUtilities (4)
Microsoft.CodeAnalysis.BannedApiAnalyzers (4)
Microsoft.CodeAnalysis.CodeStyle (4)
Microsoft.CodeAnalysis.CSharp.Symbol.UnitTests (2)
Microsoft.CodeAnalysis.PerformanceSensitiveAnalyzers (4)
Microsoft.CodeAnalysis.PublicApiAnalyzers (4)
Microsoft.CodeAnalysis.ResxSourceGenerator (4)
Microsoft.CodeAnalysis.Test.Utilities (2)
Microsoft.CodeAnalysis.Workspaces (9)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
Microsoft.DotNet.Build.Tasks.Installers (7)
Microsoft.DotNet.XUnitAssert.Tests (49)
Asserts\Sdk\CollectionTrackerTests.cs (9)
74 var span = new[] { 42, 2112 }.AsSpan();
86 var span = new[] { 42, 2112 }.AsSpan();
98 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan();
110 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan();
122 var span = new[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan();
207 var span = Array.Empty<object>().AsSpan();
215 var span = Array.Empty<object>().AsSpan();
223 var span = new object[] { 1, 2.3M, "Hello, world!" }.AsSpan();
231 var span = new object[] { 1, 2.3M, "Hello, world!", 42, 2112, new() }.AsSpan();
Asserts\SpanAssertsTests.cs (40)
115 Assert.Contains(new int[] { 3, 4 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan());
121 Assert.Contains(new string[] { "test", "it" }.AsSpan(), new string[] { "something", "interesting", "test", "it", "out" }.AsSpan());
139 var ex = Record.Exception(() => Assert.Contains(new int[] { 13, 14 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan()));
338 Assert.DoesNotContain(new int[] { 13, 14 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan());
344 Assert.DoesNotContain(new string[] { "it", "test" }.AsSpan(), new string[] { "something", "interesting", "test", "it", "out" }.AsSpan());
362 var ex = Record.Exception(() => Assert.DoesNotContain(new int[] { 3, 4 }.AsSpan(), new int[] { 1, 2, 3, 4, 5, 6, 7 }.AsSpan()));
718 Assert.Equal(value1.AsSpan(), value2.AsSpan());
719 Assert.Equal(value2.AsSpan(), value1.AsSpan());
722 Assert.Equal(value1.AsSpan(), value2.Spanify());
723 Assert.Equal(value2.AsSpan(), value1.Spanify());
726 Assert.Equal(value1.Spanify(), value2.AsSpan());
727 Assert.Equal(value2.Spanify(), value1.AsSpan());
752 assertFailure(() => Assert.Equal(new int[] { 1, 0, 2, 3 }.AsSpan(), new int[] { 1, 2, 3 }.AsSpan()));
753 assertFailure(() => Assert.Equal(new int[] { 1, 0, 2, 3 }.AsSpan(), new int[] { 1, 2, 3 }.Spanify()));
754 assertFailure(() => Assert.Equal(new int[] { 1, 0, 2, 3 }.Spanify(), new int[] { 1, 2, 3 }.AsSpan()));
775 assertFailure(() => Assert.Equal(new int[] { 1, 2, 3 }.AsSpan(), new int[] { 1, 2, 3, 4 }.AsSpan()));
776 assertFailure(() => Assert.Equal(new int[] { 1, 2, 3 }.AsSpan(), new int[] { 1, 2, 3, 4 }.Spanify()));
777 assertFailure(() => Assert.Equal(new int[] { 1, 2, 3 }.Spanify(), new int[] { 1, 2, 3, 4 }.AsSpan()));
798 Assert.Equal(value1.AsSpan(), value2.AsSpan());
799 Assert.Equal(value2.AsSpan(), value1.AsSpan());
802 Assert.Equal(value1.AsSpan(), value2.Spanify());
803 Assert.Equal(value2.AsSpan(), value1.Spanify());
806 Assert.Equal(value1.Spanify(), value2.AsSpan());
807 Assert.Equal(value2.Spanify(), value1.AsSpan());
831 assertFailure(() => Assert.Equal(new string[] { "yes", "no", "maybe" }.AsSpan(), new string[] { "yes", "no", "maybe", "so" }.AsSpan()));
832 assertFailure(() => Assert.Equal(new string[] { "yes", "no", "maybe" }.AsSpan(), new string[] { "yes", "no", "maybe", "so" }.Spanify()));
833 assertFailure(() => Assert.Equal(new string[] { "yes", "no", "maybe" }.Spanify(), new string[] { "yes", "no", "maybe", "so" }.AsSpan()));
Microsoft.Extensions.AI.Abstractions (1)
Microsoft.Extensions.AI.OpenAI (1)
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 (1)
Microsoft.Extensions.Hosting.Systemd (1)
Microsoft.Extensions.ServiceDiscovery.Dns.Tests (6)
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)
341status = bpe.Decode(ids, destinationBuffer.AsSpan().Slice(0, i), considerSpecialTokens, out idsConsumed, out charactersWritten);
351status = bpe.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens, out idsConsumed, out charactersWritten);
355Assert.Equal(expectedDecoded, destinationBuffer.AsSpan().ToString());
849Assert.Equal(OperationStatus.Done, tokenizer.Decode(ids, destinationBuffer.AsSpan(), considerSpecialTokens: true, out int idsConsumed, out int charsWritten));
852Assert.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)
Microsoft.Private.Windows.Core (2)
Microsoft.Private.Windows.Polyfills.Tests (2)
PresentationCore.Tests (1)
RepoTasks (1)
Roslyn.Diagnostics.Analyzers (4)
System.Data.Common (2)
System.Data.Odbc (3)
System.Diagnostics.DiagnosticSource (12)
System.DirectoryServices.Protocols (9)
System.Drawing.Common (57)
System\Drawing\Drawing2D\GraphicsPath.cs (19)
31: this(pts.OrThrowIfNull().AsSpan(), types.OrThrowIfNull().AsSpan(), fillMode)
69: this(pts.OrThrowIfNull().AsSpan(), types.OrThrowIfNull().AsSpan(), fillMode) { }
324public void AddLines(params PointF[] points) => AddLines(points.OrThrowIfNull().AsSpan());
351public void AddLines(params Point[] points) => AddLines(points.OrThrowIfNull().AsSpan());
401public void AddBeziers(params PointF[] points) => AddBeziers(points.OrThrowIfNull().AsSpan());
425public void AddBeziers(params Point[] points) => AddBeziers(points.OrThrowIfNull().AsSpan());
446public void AddCurve(params PointF[] points) => AddCurve(points.AsSpan(), 0.5f);
449public void AddCurve(PointF[] points, float tension) => AddCurve(points.AsSpan(), tension);
507public void AddCurve(params Point[] points) => AddCurve(points.AsSpan(), 0.5f);
510public void AddCurve(Point[] points, float tension) => AddCurve(points.AsSpan(), tension);
558public void AddClosedCurve(PointF[] points, float tension) => AddClosedCurve(points.OrThrowIfNull().AsSpan(), tension);
588public void AddClosedCurve(Point[] points, float tension) => AddClosedCurve(points.OrThrowIfNull().AsSpan(), tension);
622public void AddRectangles(params RectangleF[] rects) => AddRectangles(rects.OrThrowIfNull().AsSpan());
642public void AddRectangles(params Rectangle[] rects) => AddRectangles(rects.OrThrowIfNull().AsSpan());
731public void AddPolygon(params PointF[] points) => AddPolygon(points.OrThrowIfNull().AsSpan());
752public void AddPolygon(params Point[] points) => AddPolygon(points.OrThrowIfNull().AsSpan());
877Warp(destPoints.OrThrowIfNull().AsSpan(), srcRect, matrix, warpMode, flatness);
System\Drawing\Graphics.cs (27)
756public void DrawRectangles(Pen pen, params RectangleF[] rects) => DrawRectangles(pen, rects.OrThrowIfNull().AsSpan());
781public void DrawRectangles(Pen pen, params Rectangle[] rects) => DrawRectangles(pen, rects.OrThrowIfNull().AsSpan());
855public void DrawPolygon(Pen pen, params PointF[] points) => DrawPolygon(pen, points.OrThrowIfNull().AsSpan());
880public void DrawPolygon(Pen pen, params Point[] points) => DrawPolygon(pen, points.OrThrowIfNull().AsSpan());
915public void DrawCurve(Pen pen, params PointF[] points) => DrawCurve(pen, points.OrThrowIfNull().AsSpan());
937DrawCurve(pen, points.OrThrowIfNull().AsSpan(), tension);
973DrawCurve(pen, points.OrThrowIfNull().AsSpan(), offset, numberOfSegments, tension);
1000public void DrawCurve(Pen pen, params Point[] points) => DrawCurve(pen, points.OrThrowIfNull().AsSpan());
1022DrawCurve(pen, points.OrThrowIfNull().AsSpan(), tension);
1055DrawCurve(pen, points.OrThrowIfNull().AsSpan(), offset, numberOfSegments, tension);
1083DrawClosedCurve(pen, points.OrThrowIfNull().AsSpan());
1114DrawClosedCurve(pen, points.OrThrowIfNull().AsSpan(), tension, fillmode);
1139public void DrawClosedCurve(Pen pen, params Point[] points) => DrawClosedCurve(pen, points.OrThrowIfNull().AsSpan());
1165DrawClosedCurve(pen, points.OrThrowIfNull().AsSpan(), tension, fillmode);
1251FillRectangles(brush, rects.AsSpan());
1274FillRectangles(brush, rects.OrThrowIfNull().AsSpan());
1304FillPolygon(brush, points.OrThrowIfNull().AsSpan(), fillMode);
1343FillPolygon(brush, points.OrThrowIfNull().AsSpan(), fillMode);
1446FillClosedCurve(brush, points.OrThrowIfNull().AsSpan());
1487FillClosedCurve(brush, points.OrThrowIfNull().AsSpan(), fillmode, tension);
1514FillClosedCurve(brush, points.OrThrowIfNull().AsSpan());
1550FillClosedCurve(brush, points.OrThrowIfNull().AsSpan(), fillmode, tension);
2363public void DrawLines(Pen pen, params PointF[] points) => DrawLines(pen, points.OrThrowIfNull().AsSpan());
2588TransformPoints(destSpace, srcSpace, pts.AsSpan());
2614TransformPoints(destSpace, srcSpace, pts.AsSpan());
2790DrawBeziers(pen, points.OrThrowIfNull().AsSpan());
2821public void DrawBeziers(Pen pen, params Point[] points) => DrawBeziers(pen, points.OrThrowIfNull().AsSpan());
System.Formats.Cbor (3)
System.Formats.Nrbf (6)
System.IO.Compression (1)
System.Net.HttpListener (1)
System.Net.NetworkInformation (2)
System.Net.Security (8)
System.Net.Sockets (3)
System.Net.WebClient (2)
System.Private.CoreLib (14)
System.Private.Windows.Core (2)
System.Private.Xml (1)
System.Reflection.Metadata (5)
System.Resources.Extensions (1)
System.Runtime.Numerics (5)
System.Security.Cryptography (20)
System.Security.Cryptography.Cose (6)
System.Security.Cryptography.Pkcs (8)
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 (3)
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 (5)
Text.Analyzers (4)
xunit.assert (1)