Skip to content

[Repo Assist] test: add unit tests for JsonValue.ParseMultiple and JsonValue.Load#1734

Draft
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-jsonvalue-parsemultiple-load-2026-04-08-f679d1349d67a16e
Draft

[Repo Assist] test: add unit tests for JsonValue.ParseMultiple and JsonValue.Load#1734
github-actions[bot] wants to merge 2 commits intomainfrom
repo-assist/test-jsonvalue-parsemultiple-load-2026-04-08-f679d1349d67a16e

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 8, 2026

🤖 This is an automated pull request from Repo Assist, an AI assistant for this repository.

Summary

JsonValue.ParseMultiple, JsonValue.Load(Stream), JsonValue.Load(TextReader), and JsonValue.WriteTo had no direct unit tests. This PR adds 11 tests covering these methods.

Motivation

  • ParseMultiple is the primary API for parsing NDJSON (newline-delimited JSON), a format used widely in log streaming and data pipelines. It had zero test coverage.
  • Load(Stream) / Load(TextReader) are convenience IO methods used in real applications; verifying their behaviour directly (not just through the type provider) is valuable.
  • WriteTo serialisation options (None / DisableFormatting) were tested indirectly via ToString() but not via the WriteTo path directly.

New Tests

ParseMultiple (NDJSON / concatenated JSON)

Test What it verifies
Empty string returns empty sequence boundary condition
Single value minimal happy path
Newline-delimited JSON (3 objects) canonical NDJSON use-case
Whitespace-separated values generic multi-value separator handling
Mixed types in sequence object, array, string, bool, null together
Lazy evaluation (Seq.head only) sequence laziness guarantee

JsonValue.Load(Stream) / Load(TextReader)

  • Basic object parsing from MemoryStream
  • Nested structure parsing from MemoryStream
  • Array content from StringReader (as TextReader)

JsonValue.WriteTo

  • DisableFormatting produces compact {"a":1,"b":"x"} output
  • None produces indented output with newlines and spaces

Test Status

  • dotnet test tests/FSharp.Data.Core.Tests/2920 passed, 0 failed (up from 2909; 11 new tests)
  • ✅ Code formatted with Fantomas 7.0.1

Generated by Repo Assist

Generated by 🌈 Repo Assist, see workflow run. Learn more.

To install this agentic workflow, run

gh aw add githubnext/agentics/workflows/repo-assist.md@7ee2b60744abf71b985bead4599640f165edcd93

- ParseMultiple (NDJSON): 6 tests covering empty string, single value,
  newline-delimited JSON, whitespace-separated values, mixed types,
  and lazy evaluation guarantee
- JsonValue.Load(Stream): 2 tests (basic object, nested structure)
- JsonValue.Load(TextReader): 1 test (array content)
- JsonValue.WriteTo: 2 tests (DisableFormatting compact output,
  None/default indented output)

All 2920 tests pass (11 new tests; up from 2909).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants