Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Added System.Memory.Polyfill Project #2339

Merged
merged 14 commits into from
Jun 5, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
c8d31c4
Bug fix in BufferWriter
KrzysztofCwalina Mar 20, 2018
8ee6979
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina Mar 22, 2018
33da66f
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina Mar 22, 2018
ee23d6b
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina Mar 22, 2018
132efef
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina Mar 23, 2018
f6d44ca
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina Apr 10, 2018
954f079
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina May 1, 2018
3c3b978
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina May 3, 2018
6b160a7
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina May 3, 2018
a5dfae9
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina May 10, 2018
b89ba55
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina May 31, 2018
23415be
Merge branch 'master' of https://github.com/dotnet/corefxlab
KrzysztofCwalina Jun 4, 2018
8a5e662
Added System.Memory.Polyfill Project
KrzysztofCwalina Jun 4, 2018
42e41c5
PR review feedback and build fix
KrzysztofCwalina Jun 5, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src/System.Memory.Polyfill/System.Memory.Polyfill.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,10 @@
<Description>Adapters for Span APIs</Description>
<TargetFrameworks>netstandard1.3;netcoreapp2.1</TargetFrameworks>
<PackageTags>Span Memory Adapter</PackageTags>
<!-- disable automatic compile item inclusion so that we can set the correct metadata on TextTemplate-generated sources -->
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
<PackageReference Include="System.Buffers" Version="$(SystemMemoryVersion)" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use SystemBuffersVersion instead of SystemMemoryVersion.

<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="$(SystemCompilerServicesUnsafeVersion)" />
</ItemGroup>
<ItemGroup>
<Compile Include="System\**\*.*" />
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions tests/System.Memory.Polyfill.Tests/Int32.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ public class Int32Tests
[Fact]
public void Int32TryParse()
{
char[] buffer = int.MaxValue.ToString().ToCharArray();
ReadOnlySpan<char> span = buffer.AsSpan();
ReadOnlySpan<char> span = int.MaxValue.ToString().ToCharArray().AsSpan();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the .ToCharArray() necessary?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed in the new PR

Assert.True(Int32Polyfill.TryParse(span, out int value));
Assert.Equal(int.MaxValue, value);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\tools\common.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp2.1</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetsWindows)' == 'true'">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is listing netcoreapp2.1 TFM here redundant or required (for Windows only)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed it in the new PR. This actually did not work in the CI. I changed it to use netcoreapp2.0 to force the fallback path.

<TargetFrameworks>net46;netcoreapp2.1</TargetFrameworks>
<AssemblyOriginatorKeyFile>../../tools/test_key.snk</AssemblyOriginatorKeyFile>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you remove these properties?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ericstj suggested that they were not necessary for tests.

<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<Description></Description>
<Copyright>Microsoft Corporation, All rights reserved</Copyright>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="xunit" Version="2.3.1" />
Expand Down