Skip to content

test: Split Tests.fs into Shared / Tests / PrimitiveTests#300

Open
dimension-zero wants to merge 1 commit into
fsprojects:masterfrom
dimension-zero:pr/11-test-split
Open

test: Split Tests.fs into Shared / Tests / PrimitiveTests#300
dimension-zero wants to merge 1 commit into
fsprojects:masterfrom
dimension-zero:pr/11-test-split

Conversation

@dimension-zero
Copy link
Copy Markdown
Contributor

Summary

tests/Argu.Tests/Tests.fs was a single 1115-line file containing two unrelated test modules and a wodge of shared DU types. Break it into:

  • Shared.fsArgu.Tests.Shared module with the base union types (Argument, PushArgs, CheckoutArgs, …) plus the cached parser instance and parseFunc helper.
  • Tests.fsArgu Tests Main List, now ~800 lines, opens Argu.Tests.Shared instead of declaring the schema inline.
  • PrimitiveTests.fs — the previously co-located Argu Tests Main Primitive module, including its self-contained ArgumentPrimitive schema.

Why

The original critique called out one-file 1100-line test modules as a navigation problem. This is the first split pass: schema in one place, the two existing modules cleanly separated. Deeper splits by feature area (subcommands, AppSettings, custom assignment, …) can land on top of this without touching the schema again.

Test plan

  • dotnet build -c Release — clean
  • dotnet test -c Release — 112/112 pass (unchanged)

Tests.fs was a single 1115-line file containing two unrelated modules
plus a wodge of base DU types and a shared parser instance. Break it
into:

- `Shared.fs` — top-level `Argu.Tests.Shared` module with the base
  union types (`Argument`, `PushArgs`, …) and the cached `parser`
  instance plus `parseFunc` helper.
- `Tests.fs` — `Argu Tests Main List`, now ~800 lines, opens
  `Argu.Tests.Shared` instead of declaring the schema inline.
- `PrimitiveTests.fs` — the previously co-located
  `Argu Tests Main Primitive` module, including its self-contained
  `ArgumentPrimitive` schema.

This is the first navigation pass; deeper splits by feature area
(subcommands, AppSettings, custom assignment, …) can land on top of
this without touching the schema again.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant