Conversation
… test - Add GenerativeEventsTests.fs: 4 tests verifying that ProvidedEvent produces correct events in generated assemblies (instance and static events, add/remove method signatures, handler type, event count). - Add GenerativeProviderWithNamedArgAttrs type provider and a test in BasicGenerativeProvisionTests.fs exercising the NamedArguments encoding path (lines 15696-15697 of ProvidedTypes.fs) — verifies DebuggerDisplayAttribute with both a constructor arg and a named property arg round-trips correctly through GetGeneratedAssemblyContents. 117 tests pass (was 110 before these additions). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
3 tasks
dsyme
approved these changes
Mar 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 This is an automated PR from Repo Assist, an AI assistant for this repository.
Summary
Two categories of testing improvement for generative type providers, both targeting previously untested code paths.
1 — Generative event tests (
GenerativeEventsTests.fs, new file, 4 tests)ProvidedEventwas used inBasicGenerativeProvisionTests.fsto construct a type, but no test ever loaded the resulting generated assembly and verified that events survived the round-trip. The new file adds:Generative instance event is presentEventHandlerTypeis correct, add/remove are instance methodsInstance event add/remove methods have correct signaturesadd_Changed/remove_Changednames, singleEventHandlerparameterGenerative static event is presentGenerative type has expected event count2 — Named-argument custom attribute test (
BasicGenerativeProvisionTests.fs, 1 test)Existing custom-attribute tests only exercised positional constructor arguments (
ConstructorArguments). TheNamedArgumentsencoding path indefineCustomAttrs(ProvidedTypes.fs lines 15696–15697) was reachable but untested. The new test:GenerativeProviderWithNamedArgAttrs— a generative type provider that attachesDebuggerDisplayAttribute("{Value}")with a named property argumentName = "MyProp"to a provided property."{Value}"and the named argName = "MyProp"surviveGetGeneratedAssemblyContents→Assembly.Load→GetCustomAttributesData().Test Status
(117 tests; was 110 before this PR's additions, with the delta from PRs #470 / #475 already merged.)