Commit Graph
426 Commits
Author SHA1 Message Date
Yoh Deadfall 7c38fc942f Eliminated info creation for non-public properties (#2278) 2020-02-02 11:56:18 -08:00
Layomi Akinrinade 55e1fda6f0 Update ActiveIssue URLs for Newtonsoft tests for immutable collections (#6215) 2020-01-30 21:57:20 -05:00
9a8f52c0d4 [master] Update dependencies from 4 repositories (#2074)
* Update dependencies from https://github.com/dotnet/arcade build 20200122.3

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20072.3
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20072.3
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20072.3
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20072.3
- Microsoft.DotNet.Build.Tasks.Configuration - 5.0.0-beta.20072.3
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20072.3
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20072.3
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20072.3
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20072.3
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20072.3
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20072.3
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20072.3
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20072.3
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20072.3

* Update dependencies from https://github.com/dotnet/runtime-assets build 20200122.1

- System.Windows.Extensions.TestData - 5.0.0-beta.20072.1
- System.Security.Cryptography.X509Certificates.TestData - 5.0.0-beta.20072.1
- System.Private.Runtime.UnicodeData - 5.0.0-beta.20072.1
- System.Net.TestData - 5.0.0-beta.20072.1
- System.IO.Packaging.TestData - 5.0.0-beta.20072.1
- System.IO.Compression.TestData - 5.0.0-beta.20072.1
- System.Drawing.Common.TestData - 5.0.0-beta.20072.1
- System.ComponentModel.TypeConverter.TestData - 5.0.0-beta.20072.1

* Update dependencies from https://github.com/dotnet/arcade build 20200123.17

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20073.17
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20073.17
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20073.17
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20073.17
- Microsoft.DotNet.Build.Tasks.Configuration - 5.0.0-beta.20073.17
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20073.17
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20073.17
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20073.17
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20073.17
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20073.17
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20073.17
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20073.17
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20073.17
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20073.17

* Update dependencies from https://github.com/dotnet/arcade build 20200124.6

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20074.6
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20074.6
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20074.6
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20074.6
- Microsoft.DotNet.Build.Tasks.Configuration - 5.0.0-beta.20074.6
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20074.6
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20074.6
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20074.6
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20074.6
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20074.6
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20074.6
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20074.6
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20074.6
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20074.6

* Update dependencies from https://github.com/dotnet/arcade build 20200125.3

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20075.3
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20075.3
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20075.3
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20075.3
- Microsoft.DotNet.Build.Tasks.Configuration - 5.0.0-beta.20075.3
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20075.3
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20075.3
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20075.3
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20075.3
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20075.3
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20075.3
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20075.3
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20075.3
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20075.3

* Update dependencies from https://github.com/dotnet/arcade build 20200126.3

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20076.3
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20076.3
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20076.3
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20076.3
- Microsoft.DotNet.Build.Tasks.Configuration - 5.0.0-beta.20076.3
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20076.3
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20076.3
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20076.3
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20076.3
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20076.3
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20076.3
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20076.3
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20076.3
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20076.3

* Update dependencies from https://github.com/dotnet/arcade build 20200127.7

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20077.7
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20077.7
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20077.7
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20077.7
- Microsoft.DotNet.Build.Tasks.Configuration - 5.0.0-beta.20077.7
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20077.7
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20077.7
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20077.7
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20077.7
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20077.7
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20077.7
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20077.7
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20077.7
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20077.7

* Bang some nullability warnings on generics

* Update dependencies from https://github.com/dotnet/arcade build 20200129.8

- Microsoft.DotNet.XUnitExtensions - 5.0.0-beta.20079.8
- Microsoft.DotNet.VersionTools.Tasks - 5.0.0-beta.20079.8
- Microsoft.DotNet.ApiCompat - 5.0.0-beta.20079.8
- Microsoft.DotNet.Arcade.Sdk - 5.0.0-beta.20079.8
- Microsoft.DotNet.Build.Tasks.Configuration - 5.0.0-beta.20079.8
- Microsoft.DotNet.Build.Tasks.Feed - 5.0.0-beta.20079.8
- Microsoft.DotNet.Build.Tasks.Packaging - 5.0.0-beta.20079.8
- Microsoft.DotNet.Build.Tasks.SharedFramework.Sdk - 5.0.0-beta.20079.8
- Microsoft.DotNet.CodeAnalysis - 5.0.0-beta.20079.8
- Microsoft.DotNet.GenAPI - 5.0.0-beta.20079.8
- Microsoft.DotNet.XUnitConsoleRunner - 2.5.1-beta.20079.8
- Microsoft.DotNet.GenFacades - 5.0.0-beta.20079.8
- Microsoft.DotNet.Helix.Sdk - 5.0.0-beta.20079.8
- Microsoft.DotNet.RemoteExecutor - 5.0.0-beta.20079.8

* Update dependencies from https://github.com/microsoft/vstest build 20200130-01

- Microsoft.NET.Test.Sdk - 16.5.0-preview-20200130-01

* Remove obsolete namespace for MonoAttribute

Co-authored-by: Santiago Fernandez Madero <[email protected]>
Co-authored-by: Viktor Hofer <[email protected]>
2020-01-30 17:20:32 +01:00
Stephen Toub 9999d4b86e Clean up stale issue links (#2063)
- In some cases, I deleted ActiveIssues associated with issues where the problem was supposedly fixed.  We'll see.
- In some cases, I deleted test cases entirely, e.g. where the corresponding issue said effectively "we'll live with the behavior" or "another repo is responsible for this now" (paraphrasing), or where the tests were initially added to the repo years ago already disabled and against bug numbers from some old bug database.
- In some cases, I replaced the link with the correct one.
- In some cases, I re-opened closed issues.
2020-01-23 17:05:05 -05:00
Roman Marusyk 4cb104ee49 Fix some links to coreclr repo (#1991) 2020-01-22 06:41:26 -08:00
Erhan Atesoglu caa2ed9698 Rebased version of CoreFX renames (#1941)
* FinalCoreFXRenames

The last of the CoreFX renames.

* Update DirectorySearcher.cs

Fixed typo in DirectorySearcher.cs

* Update TestClasses.SimpleTestClassWithObjectArrays.cs

This fixes the expected value of the tests to runtime, instead of corefx.

* Update PersistedFiles.Names.Unix.cs

Adds a note to not update the corefx reference.
2020-01-21 20:05:51 -08:00
David Cantu 339b44734d Add support for preserve references on JSON (#655)
* Initial commit for JSON reference handling / preserve references

* Remove ReferenceHandling.Ignore option

* Code clean-up.

* Remove stale tests.

* Address PR feedback

* Reference handling inline (#1)

* Inline ReferenceHandling logic within main methods.

* remove stale Handle*Ref methods

* Refactor the code for Deserialization
* Create methods to reuse code
* Try to isolate Preserve logic as much as I can
* Replaced Exceptions for ThrowHelper methods

* Remove stale condition on $ref

* Add AggressiveInlining to HandlePropertyNameDefault

* Inline feature code in Serialization

* Fix preserve references for ExtensionData

* Split Reference dictionary into two, for (De)Serialize each.
Add Reference EqualityComparer to Serialize dictionary.

* Do not set PropertyName to s_missingProperty to avoid race condition issues.

* Remove Asserts that compare against an exception message.

* Set preserved array passing setPropertyDirectly = true to avoid issue when enumerable is already initialized.

* Code clean-up.

* Separate write code into WritePreservedObject and WriteReferenceObject

* Address some PR feedback:
* Switched ReferenceResolver to access it through a read-only property that initializes it the first time is tried to be accesed.
* Renamed some methods and properties
* Refactored WriteReference* methods.
* Fixed Exception messages
* Removed literal message comparison on tests.

* * Add round-tripping coverage to suitable unit tests
* Fix issues found with Round-tripping scenarios
  * Move DictionaryPropertyIsPreserved to EndProperty() in order to fix issue where two dictionary properties were next to each other and the DictionaryPropertyIsPreserved was not reset.
  * Add ReadStackFrame.IsNestedPreservedArray in order to identify preserved arrays nested and prevent using setPropertyDirectly on them.

* Add nullability annotations

* Code clean-up, reword comments and removed unnecesary properties in ReferenceHandling

* Fix issue where an object that tries to map into an enumerable could skip the validation that prevents this.

* Fix issue where the wrong type was passed into the throw helper for nested enumerable in HandleStartObject

* Address PR comments.

* Refactor flags on ReadStackFrame to avoid using unrelated fields for validation.

* Consolidated MetadataPropertyName enum logic on read and write.

* Reuse HandleStartObjectInEnumerable to handle arrays with metadata nested in a Dictionary.

* Refactor code:
* Change ReferenceResolver from class to struct to avoid one allocation.
* Replace propertyName.ToArray() for constant arrays in order to avoid allocation.

* Move some exception logic to the ThrowHelper class.

* * Apply optimizations:
  * Use PropertyCacheArray on Values property lookup.
  * Make Comparer static field to avoid one allocation at runtime.
* Document reasoning for DefaultReferenceResolver and ReferenreEqualsEqualityComparer

* Address PR comments.

* Addres more PR feedback:
* Add documentation to DefaultReferenceResolver public methods.

* Address PR feedback.

* Adderss more PR suggestions.

* * Move tests to Serialization namespace.
* On $values, set PropertyName on state.Current.JsonPropertyName instead.
2020-01-18 16:40:36 -08:00
Maher Jendoubi 10834ce513 Contributing: fixed some typos (#1905) 2020-01-18 16:32:21 -08:00
Jan KotasandStephen Toub 0b25063ec0 More renames of full framework to .NET Framework (#1900)
* More renames of full framework to .NET Framework

* Apply suggestions from code review

Co-Authored-By: Stephen Toub <[email protected]>
2020-01-18 11:04:59 -08:00
Stephen ToubandJan Kotas ccf6aedb63 Address more issue numbers in the code (#1888)
* Address more issue numbers in the code

Replaced a bunch of unadorned issue numbers with links, so we know which repo the issue is for.  In some cases the repo was named, but for consistency I still replaced it with a link.

In some cases, in particular where the issue had been closed saying effectively "we're not going to do anything here", I removed TODOs and the associated issue numbers.

In a few cases, the TODO and issue number was to say "we should do X when Y is fixed", so I did X since Y was fixed.

* Apply suggestions from code review

Co-Authored-By: Jan Kotas <[email protected]>

* Address PR feedback

* Fix OrderedEnumerable by using MemoryExtensions.Sort

Co-authored-by: Jan Kotas <[email protected]>
2020-01-18 00:52:17 -08:00
Stephen Toub 04f22268ef Change all ActiveIssues to use Uris instead of numbers (#1768) 2020-01-15 23:21:36 -05:00
Josh Groves 7b00890e1f Fix typo (#1528) 2020-01-09 09:49:31 -08:00
Jan Kotas 25d316cefa Move Corelib shared files under Common (#1307)
Contributes to #1232
2020-01-06 09:07:16 -08:00
buyaa-n 81bf79fd9a Annotate System.Text.Json for nullable (#528)
Annotate System.Text.Json for nullable
2019-12-31 12:01:19 -08:00
Jan Kotas 0647ec3149 Replace GetDirectoryNameOfFileAbove with GetPathOfFileAbove where possible (#1175) 2019-12-27 00:31:18 -08:00
Layomi Akinrinade 8c0a1d9198 Merge pull request #784 from layomia/nested_dicts
Improve serialization support for nested dictionaries
2019-12-19 19:27:35 -08:00
HenrikandAhson Khan bdfbad5554 JsonNull return false when comparing against null (#842)
* JsonNull return false when comparing against null

I'ved modified JsonNulls comparison methods to return false when
compared against null, the matching test have also been updated
in change

Fix #820

* Updated xml comments to reflect my changes

I have updated the xml comments to reflect the changes
that was made in JsonNull and removed left over comment
in JsonNullTests

* Applied suggested change

Applied the suggested change to correct xml documentation

Co-Authored-By: Ahson Khan <[email protected]>

* Applied Suggested change

Applied the suggested change to correct xml documentation

Co-Authored-By: Ahson Khan <[email protected]>
2019-12-18 13:28:07 -08:00
Viktor Hofer c2d89a824a Remove usage of TargetGroup where possible (#899)
In non-infra related paths we don't need to check on TargetGroup anymore
and can instead use the well-known TargetFramework property.
2019-12-16 19:36:55 +01:00
Anirudh Agnihotry 3b9abae5aa Removing "netcoreapp" and "netfx" TargetGroup (#457)
* netcoreapp -> netcoreapp5.0 in .sln files

* netcoreapp; -> netcoreapp5.0;  , netcoreapp- to netcoreapp5.0-

* netcoreapp- -> netcoreapp5.0 in .csproj

* 'netcoreapp -> 'netcoreapp5.0 in .csproj

* done with libraries sub folder

* missed semicolon

* minor changes

* netcoreapp -> netcoreapp5.0 in some extra files

* vNext target variable in configurations.props

* netcoreapp => netcoreapp5/0 in some other .props file

* netcoreapp -> vnext in .csproj

* making the netcorepap framework switch work

* fixing sendToHelix and linux build

* TargetFrameworkVNext -> netcoreappCurrent

* case correct netcoreappcurrent

* fixing send to helix zip path

* netfx -> net472 in .sln

* netfx; -> net472; in .props

* netfx- -> net472- in .props

* netfx - -> net472- in .csproj

* 'netfx-> 'net472 in .csproj

* netfx -> net472 manual change

* fixing ci build for netfx

* Not trying to change the global property

* Fixing build failure due to master changes in net https tests

* adding documentaiton and fixing filtering

* netcoreapp -> netcore5.0 in py file

* changing the path to use netcoreapp5.0 version

* feedback and override corefx path corrected in installers

* remaing netcoreapp5.0 changes done

* netcoreapp-> netcoreapp5.0 after live builds

* net472 -> netframeworkcurrent
2019-12-14 12:22:29 -08:00
Layomi Akinrinade f5f82522d2 Add note about test generation depth 2019-12-13 16:25:35 -08:00
Layomi Akinrinade 0e31f96f9c Document tests and add some more 2019-12-12 17:56:47 -08:00
Layomi Akinrinade 02dd42918e Improve serialization support for nested dictionaries 2019-12-11 19:14:05 -08:00
Anton Landor 2c8d4863a7 Added tests to cover all branches of JsonNodeOptions (#436)
* Added tests to cover all branches of JsonNodeOptions.

* Created a test class for JsonNodeOptions and moved relevant tests to it. Also implemented tests for CommentHandling and AllowTrailingCommas options.

* Added tests for default values. Moved JsonNodeOptionsTests to the correct item group.

* Added test to make sure default JsonNodeOptions have equal values to JsonNodeOptions created from default constructor.

* Added missed options arguments.

* Added assertions to make sure default JsonNodeOptions values are as expected.
2019-12-10 23:59:32 -08:00
Eugene Samoylov 8fe5240a40 Add support for escaped characters in JsonString (for {Try}GetDateTime{Offset}) (#386)
* Add support for escaped characters in JsonString (for {Try}GetDateTime{Offset})

* Fix the review issues

* Fix a mistake after resolving a merge conflict

* Change `var` to explicit type
2019-12-08 23:56:59 -08:00
Kristian Hellang a6acafd32d Use MaxExpansionFactorWhileTranscoding instead of counting bytes (#478) 2019-12-05 17:41:21 -08:00
Stephen Toub e90b018a3b Fix up a bunch of repo references in docs (#60)
This is just prelminary, as all of the docs need to be rationalized with each other now that they're all in the same repo.  But it at least keeps most of the links working for now.
2019-11-15 19:15:37 +01:00
Santiago Fernandez Madero d8adaeeff2 Fix test build of test project that referenced corefx shared corelib directly and cleanup common path usages (#47)
* Fix test build break and update common path usages to use property

* Use normalize directory for CommonPath and CommonTestPath

* Update instances of CommonPath and CommonTestPath to not use trailing \
2019-11-14 21:03:07 +01:00
Viktor Hofer 8e3694fbdd Fix CodeAnalysis.ruleset path (#35) 2019-11-14 15:38:15 +01:00
marcnet80 9319d62aab DictionaryKeyPolicy not applied to keys that contain non primitive ty… (dotnet/corefx#41691)
* DictionaryKeyPolicy not applied to keys that contain non primitive types dotnet/corefx#41176

https://github.com/dotnet/corefx/issues/41176#event-2697607085

* dotnet/corefx#41176: DictionaryKeyPolicy not applied to keys that contain non primitive types

https://github.com/dotnet/corefx/issues/41176

* add unit tests

https://github.com/dotnet/corefx/pull/41691

* Remove check for JsonExtensionDataAttribute to avoid reflection.


Commit migrated from https://github.com/dotnet/corefx/commit/d9dd0dac4285368002740333d6772d4db79d82c1
2019-11-13 16:49:54 -08:00
buyaa-n ad6c91b067 Large json serialization/deserialization tests (dotnet/corefx#39668)
* Test large json serializaiton/deserialization

* Fixing test failure, applying feedback

* Add circular dependency test with large object

* Added test writing an object right at threshold level, removed unnecessary test cases

* Fixing typo

* Using VS generated POCO for test

* Addressing feedback

* Applying feedback

* Applying feedback

* Applying feedback

* Refactored the test Json schema

* Commenting failing case

* Applying feedback

* Applying feedback

* Enabling fixed tests


Commit migrated from https://github.com/dotnet/corefx/commit/20334125a70444b5e8cf35f3f661911cd85a78b5
2019-11-13 16:14:45 -08:00
Katarzyna Bułat 36b6c52ddc JSON DOM refactor (dotnet/corefx#41041)
* work on review comments, documentation changes included

* work on including review comments

* work on including review comments

* StringComparison methods improvements

* work on adressing review comments

* helping comment added

* StringComparison tests improved to check all enum values

* setting CurrentCulture test added

* review comments included

* build fixes

* CurrentCulture test removed

* Address nits and react to recent API changes.


Commit migrated from https://github.com/dotnet/corefx/commit/a0f71fa14ecd17c6aee146b8ef76aaec0dd389ed
2019-11-13 16:14:02 -08:00
Viktor Hofer 00d3a3b733 Update CoreLib path for consolidation (dotnet/corefx#42577)
Commit migrated from https://github.com/dotnet/corefx/commit/dc6136f34c7d4ebbc493a7bb6cf1d15bc82250e6
2019-11-13 20:48:15 +01:00
Layomi Akinrinade 184355fd76 Set values of array and immutable collection properties directly (dotnet/corefx#42420)
* Set values of array and immutable collection properties directly

* Address review feedback


Commit migrated from https://github.com/dotnet/corefx/commit/a528006b4536e5b73227285b57d2a56116532506
2019-11-12 23:08:32 -08:00
Layomi Akinrinade abcbe94bbb Fix exception tests where we are asserting against the literal message (dotnet/corefx#42569)
* Fix up exception tests where we are asserting against the literal message

* Remove null assignments


Commit migrated from https://github.com/dotnet/corefx/commit/dd1892dc53e28b481bfab364a08573214d3df462
2019-11-13 05:25:46 +00:00
Ahson Khan 520e168dc8 Add test to verify that JsonEncodedText and Utf8JsonWriter use upper-case hex digits when escaping (2). (dotnet/corefx#42566)
* Add test to verify that JsonEncodedText and Utf8JsonWriter use
upper-case hex digits when escaping.

* Add test to verify that JsonEncodedText and Utf8JsonWriter use
upper-case hex digits when escaping.

* Fix spacing issue in expected text.


Commit migrated from https://github.com/dotnet/corefx/commit/6878693e4bdeb509abfdf51ad40a5a1aae46e2e4
2019-11-13 00:10:30 +00:00
32d4012957 Support For Getting base-64 String as Byte Array (dotnet/corefx#41467)
* Implemented support for getting Base64 as an equivalent byte array

* New implementation for base-64 support as suggested in review. Added new test cases for it.

* Changed comment

in -> and

Co-Authored-By: Ahson Khan <[email protected]>

* Updated minimum length for TryGetBytesFromBase64 to match minimum length of base-64 string

Co-Authored-By: Günther Foidl <[email protected]>

* Added old Convert.FromBase64String implementation for older platforms. arrayReturnToPool is now cleared before return. Added test cases for edge cases and full branch coverage. Changed magic number to predefined constant.

* Changed catch-all to only catch FormatException. Removed try-finally since it is most likely unnecessary. Now only clears the sliced buffer.

* Changed back to a try-finally solution for readability.

* Using JsonConstants.StackallocThreshold instead of magic number

Co-Authored-By: Ahson Khan <[email protected]>

* Added test to validate TryGetBytesFromBase64(...) gives the corrresulting bytes.

* Allocate to JsonConstants.StackallocThreshold when doing stackalloc

Co-Authored-By: Stephen Toub <[email protected]>


Commit migrated from https://github.com/dotnet/corefx/commit/6a591b2d24869657094816418c46593337550a32
2019-11-12 14:42:27 -08:00
Layomi Akinrinade 48def517c6 Provide more specific exception message when an enumerable or dictionary cannot be instantiated (dotnet/corefx#42497)
* Provide more specific exception message when an enumerable or dictionary cannot be instantiated

* Address review feedback


Commit migrated from https://github.com/dotnet/corefx/commit/961bb667a056bb3b9a5f32e22aed8bb64eaddcad
2019-11-12 13:15:10 -08:00
Stephen Toub 9524bb599e Fix StyleCop rule SA1129 ("Do not use default value type constructor") (dotnet/corefx#42531)
Commit migrated from https://github.com/dotnet/corefx/commit/88f40addc220c73794f962f10d288c20c416ede1
2019-11-11 18:49:48 -05:00
Anirudh Agnihotry 3679e373a3 Bumping the assembly version to 5.0.0.0 (dotnet/corefx#41723)
* bumping the assembly Version

* correcting the resx file

* keeping netfx for oleDb

* fiixing the netfx tests as well

* fixing the DataSetExtensionsVersion

* removing netstandard2.0 from ref in datasetextensions


Commit migrated from https://github.com/dotnet/corefx/commit/9a4ed0d00bc642b015974684c32b00650426429f
2019-11-11 10:43:58 -08:00
Santiago Fernandez Madero 50d8a5f65d Cleanup MSBuild conditional operators to be all in lowercase (dotnet/corefx#42491)
Commit migrated from https://github.com/dotnet/corefx/commit/ab01852685e659a685af2ace33af5b3cefdf8430
2019-11-08 14:43:17 -08:00
Stephen Toub 48afd364c6 Reduce System.Text.Json test count from ~150K to ~11K (dotnet/corefx#42365)
One theory was added with ~140K inputs and is causing our infrastructure to go haywire.

Commit migrated from https://github.com/dotnet/corefx/commit/9862cf5e1d1a73a5e62beef8edc2fc1f0f7e5d60
2019-11-04 12:58:22 -05:00
Layomi Akinrinade 360f0b0838 Guard against null refs when attempting to deserialize mismatched JSON into collections (dotnet/corefx#42254)
* Guard against null refs when attempting to deserialize mismatched JSON into collections

* Address review feedback

* Address review feedback


Commit migrated from https://github.com/dotnet/corefx/commit/eb41b7841f1d8edc499a8c0fbaec5e4d53187fa0
2019-11-01 18:37:19 -07:00
Kristian Hellang 17f59b60e2 Formatting and parsing changes to JsonString (dotnet/corefx#41940)
* Pull duplicated code into JsonWriterHelper

* Add helpers for parsing and formatting ISO dates

* Update tests to expect new format

* Use new helpers in JsonString methods

* Rename methods

* Check for valid parse length

* Use AsSpan extension to work around missing implicit operators on netfx

* More netfx workarounds

* Use constant for stackalloc length

* Add back temp span to avoid writing too much when trimming

* Move IsValidDateTimeOffsetParseLength to JsonHelpers

* Always use StackallocThreshold instead of calling GetUtf8ByteCount

* Remove redundant length checks done by IsValidDateTimeOffsetParseLength

* Adapt test pattern from Utf8JsonWriterTests

* Revert "Always use StackallocThreshold instead of calling GetUtf8ByteCount"

This reverts commit dotnet/corefx@0d29b64616.


Commit migrated from https://github.com/dotnet/corefx/commit/21fd4d2a70447064aacb6536278f6e8cc1c9e2d5
2019-11-01 16:10:04 -04:00
Viktor Hofer 926874e00a Use Package suffix instead of PackageId and Version suffix instead of PackageVersion (dotnet/corefx#42289)
* Use Package suffix instead of PackageId

* Manual darc update from build '20191101.2'


Commit migrated from https://github.com/dotnet/corefx/commit/931f79e4670cb73c9347e14714fd892907be6630
2019-11-01 18:27:23 +01:00
Layomi Akinrinade fa14ce5fc6 Honor dictionary key policy when entry value is null (dotnet/corefx#42267)
* Honor dictionary key policy when entry value is null

* Address review feedback

* Remove reverse Json checks


Commit migrated from https://github.com/dotnet/corefx/commit/a24db0ba5666f46f50649810fe698ad267b60331
2019-10-31 19:27:18 -07:00
Steve Harter 5b588fc072 Extend BOM test (dotnet/corefx#42279)
Commit migrated from https://github.com/dotnet/corefx/commit/5d92ba3e6bf4bf8f211f43ad4717572a2a3b4539
2019-10-31 20:48:02 -04:00
Steve Harter db28ca871a Fix deserialize issue with a large Stream containing a BOM (dotnet/corefx#42206)
Commit migrated from https://github.com/dotnet/corefx/commit/9009ad1ebf44656a60f306a114ecdbd64c6a1d23
2019-10-30 17:00:33 -05:00
Ahson Khan 1510fdb113 Add tests for custom JavaScriptEncoder to cover the virtual code paths in TextEncoder, and address previous feedback. (dotnet/corefx#42064)
* Move using directive within ifdef to make it clear when its used.

* Add more tests for custom text encoder case.

* Fix typo in comment gaurd -> guard

* Fix up the using directives that got removed during merge conflict
resolution.

* Address feedback - fix 0x7F case, rename vectors to be self-documenting.


Commit migrated from https://github.com/dotnet/corefx/commit/62e6ccfa09322db02d6c043226bd382debc915c4
2019-10-30 11:05:12 -07:00
Stephen Toub bc3c4ad745 Move PreserveDependencyAttribute to shared (dotnet/corefx#42174)
We need to use it in corelib, too.

Commit migrated from https://github.com/dotnet/corefx/commit/51f11ec4e94f0f7b7b8bacc8e7233c0578ebd39d
2019-10-28 13:47:23 -04:00
Viktor Hofer d2999dc804 Remove versionless netstandard target group (dotnet/corefx#41984)
Commit migrated from https://github.com/dotnet/corefx/commit/26d7b6626ab0385a1158e674855f81ab73f628e0
2019-10-27 17:08:59 +01:00