Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add thorough tests for partially supported NRBF types#13490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge5 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/fix-12927

Conversation

Copy link
Contributor

CopilotAI commentedMay 20, 2025
edited
Loading

This PR adds comprehensive tests forHashtable serialization handling inCoreNrbfSerializer to ensure we're properly handling instances with unsupported content and not losing data over fields we don't currently handle (like the comparer).

The tests include:

  1. Verification thatCoreNrbfSerializer.IsFullySupportedType() correctly returnsfalse forHashtable types
  2. Tests that standardHashtable objects can be properly serialized and deserialized
  3. Tests thatHashtable objects with custom comparers:
    • Can be serialized but not deserialized byCoreNrbfSerializer
    • Retain all their data including the comparer when roundtripped through serialization
  4. Tests thatHashtable objects with custom hash code providers:
    • Can be serialized but not deserialized byCoreNrbfSerializer
    • Preserve their hash code provider information when roundtripped

These tests are important to ensure that while we may not fully handle allHashtable configurations throughCoreNrbfSerializer, we at least don't lose data when these objects pass through serialization, maintaining compatibility with existing functionality.

Fixes#12927.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • pkgs.dev.azure.com
    • Triggering command:dotnet restore src/System.Private.Windows.Core/tests/System.Private.Windows.Core.Tests/System.Private.Windows.Core.Tests.csproj (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn moreCopilot coding agent tips in the docs.

CopilotAIand others added2 commitsMay 20, 2025 20:37
…ypesCo-authored-by: JeremyKuhne <8184940+JeremyKuhne@users.noreply.github.com>
Co-authored-by: JeremyKuhne <8184940+JeremyKuhne@users.noreply.github.com>
CopilotAI changed the title[WIP] Add thorough tests for partially supported NRBF typesAdd thorough tests for partially supported NRBF typesMay 20, 2025
CopilotAI requested a review fromJeremyKuhneMay 20, 2025 20:43
@dotnet-policy-servicedotnet-policy-servicebot added the draftdraft PR labelMay 20, 2025
Copilot finished work on behalf ofJeremyKuhneMay 20, 2025 20:43
Copy link
Member

@JeremyKuhneJeremyKuhne left a comment

Choose a reason for hiding this comment

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

Do not update the global.json.

@dotnet-policy-servicedotnet-policy-servicebot added the waiting-author-feedbackThe team requires more information from the author labelMay 20, 2025
Co-authored-by: JeremyKuhne <8184940+JeremyKuhne@users.noreply.github.com>
Copy link
ContributorAuthor

Do not update the global.json.

I've reverted the changes to global.json in commitd182b49. The file is now restored to its original state with the correct SDK version.

@dotnet-policy-servicedotnet-policy-servicebot removed the waiting-author-feedbackThe team requires more information from the author labelMay 20, 2025
Copilot finished work on behalf ofJeremyKuhneMay 20, 2025 20:58
Copy link
Member

@JeremyKuhneJeremyKuhne left a comment

Choose a reason for hiding this comment

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

This code does not compile. Please fix the noted errors.

{newHashtable(StringComparer.CurrentCulture){{"key","value"}},false},

// Hashtable with hash code provider won't be deserialized by TryGetPrimitiveHashtable
{newHashtable(newCustomHashCodeProvider()){{"key","value"}},false},
Copy link
Member

Choose a reason for hiding this comment

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

This constructor overload does not exist. Use the one that takes an IComparer as a second argument (pass null for the second argument). Fix other instances in this PR.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

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

Fixed the constructor overload in commit7973629 by using the correct constructor that takes an IComparer as a second argument with null passed for the instances where only the hash code provider was needed.

@dotnet-policy-servicedotnet-policy-servicebot added the waiting-author-feedbackThe team requires more information from the author labelMay 20, 2025
Co-authored-by: JeremyKuhne <8184940+JeremyKuhne@users.noreply.github.com>
@dotnet-policy-servicedotnet-policy-servicebot removed the waiting-author-feedbackThe team requires more information from the author labelMay 20, 2025
Copy link
ContributorAuthor

This code does not compile. Please fix the noted errors.

Fixed the compilation issues in commit7973629 by:

  1. Adding CS0618 suppression for the entire class with explanatory comment
  2. Using the correct Hashtable constructor overload that takes both IHashCodeProvider and IComparer (passing null when only the provider is needed)

Copilot finished work on behalf ofJeremyKuhneMay 20, 2025 21:29
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@JeremyKuhneJeremyKuhneJeremyKuhne requested changes

Requested changes must be addressed to merge this pull request.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Add thorough tests for partially supported NRBF types

2 participants

@JeremyKuhne

[8]ページ先頭

©2009-2025 Movatter.jp