610 references to AsSpan
Aspire.Dashboard (1)
dotnet-dev-certs (1)
GenerateDocumentationAndConfigFiles (4)
http2cat (5)
IIS.FunctionalTests (5)
IIS.LongTests (5)
IIS.NewHandler.FunctionalTests (5)
IIS.NewShim.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 (2)
Microsoft.AspNetCore.DataProtection.Tests (3)
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 (1)
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (28)
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.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 (1)
Microsoft.CodeAnalysis.Workspaces (8)
Microsoft.CodeAnalysis.Workspaces.MSBuild.BuildHost (1)
Microsoft.CodeAnalysis.Workspaces.UnitTests (3)
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 (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 (23)
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)
PresentationCore.Tests (1)
Roslyn.Diagnostics.Analyzers (4)
System.Collections.Concurrent (1)
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 (12)
System.Private.Windows.Core (2)
System.Private.Xml (1)
System.Reflection.Metadata (5)
System.Resources.Extensions (1)
System.Runtime.Numerics (4)
System.Security.Cryptography (34)
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 (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 (5)
Text.Analyzers (4)
xunit.assert (3)