[Repo Assist] test: add 39 unit tests for XmlRuntime methods#1764
Draft
github-actions[bot] wants to merge 2 commits intomainfrom
Draft
[Repo Assist] test: add 39 unit tests for XmlRuntime methods#1764github-actions[bot] wants to merge 2 commits intomainfrom
github-actions[bot] wants to merge 2 commits intomainfrom
Conversation
Cover previously untested public API on XmlRuntime: - TryGetValue (empty/non-empty element) - TryGetAttribute (absent/present/namespaced attribute) - GetChild (single/zero/multiple children) - ConvertArray (empty, multiple, filtered by name, pipe-path) - ConvertOptional (zero/one/many children) - ConvertOptional2 (absent/inner-None/inner-Some) - ConvertAsName (name mismatch/match) - GetJsonValue (valid JSON/empty element throws) - TryGetJsonValue (empty/invalid/valid JSON) - CreateValue (string, int, bool) - CreateRecord (no content, attributes, text value, child elements, DateTime, DateTime with time, optional Some/None) All 45 XmlRuntime tests pass. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
13 tasks
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 pull request from Repo Assist, an AI assistant for this repository.
FSharp.Data.Runtime.XmlRuntimeis the static helper class generated code relies on for XML type provider support. It had 449 lines of source code but only 6 tests, leaving the majority of its API untested.Changes
tests/FSharp.Data.Core.Tests/XmlRuntime.fs— 39 new tests covering:TryGetValue— empty element →None; element with text →Some; empty-string value →NoneTryGetAttribute— absent attribute →None; present attribute →Some; namespace-qualified attribute nameGetChild— single matching child; zero children → exception; multiple children → exceptionConvertArray— empty; multiple values; filters by element name; pipe-separated path navigation ("parent|child")ConvertOptional— zero children →None; one child →Some; multiple children → exceptionConvertOptional2— absent; inner function returnsNone; inner function returnsSomeConvertAsName— name mismatch →None; name match →SomeGetJsonValue— valid embedded JSON; empty element → exceptionTryGetJsonValue— empty element →None; invalid JSON →None; valid JSON →SomeCreateValue— string, int,true,falseCreateRecord— no content; with attributes; text value; named child element;DateTime(date-only);DateTime(with time);option<string> Some;option<string> Noneomits child elementTest Status
dotnet test tests/FSharp.Data.Core.Tests/ --filter XmlRuntime— 45 passed, 0 failed (includes 6 pre-existing tests)mainbranch fails with pre-existingNU1902(OpenTelemetry.Api 1.15.0vulnerability); this is not caused by these changes and is addressed separately in PR [Repo Assist] eng: fix OpenTelemetry.Api GHSA-g94r-2vxg-569j by pinning >= 1.15.1 and updating GitHubActionsTestLogger to 3.0.3 #1762