Adopt ordered multi-caret markers in FCS tests (no behaviour change) - #20082
Conversation
…anchor comments Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d20cd22-45dc-411f-9163-185fd6dd54d9
Uses SourceContext.extractOrderedMarkedSources (multi-caret) to replace whole-source [<Theory>] copies with one marked source in DotOff.ArraySliceNotation (3 copies) and CurriedArguments.Regression (5 copies). No behaviour change. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 9d20cd22-45dc-411f-9163-185fd6dd54d9
|
Bug312557_2 (4 source copies -> 1 {caretN}) and Bug69673_1.CtrlSpaceForThis
(2-row Theory -> 1). No behaviour change.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9d20cd22-45dc-411f-9163-185fd6dd54d9
…caretN}
The 8 Facts shared an identical source copied per caret; now one {caret1..8}
source + a (field-name, range) cases list. No behaviour change.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9d20cd22-45dc-411f-9163-185fd6dd54d9
…source
Replaces magic ((line,col),(line,col)) tuples with {selstart}/{selend} markers
around the breakpoint span; the validation caret is inferred from {selend}
(SourceContext), so no {caret} needed. Compares against context.SelectedRange.
No behaviour change (all 6 tests green).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9d20cd22-45dc-411f-9163-185fd6dd54d9
54ac48a to
b8c97d2
Compare
Should we convert them all, so more tests could use the same infrastructure and the extra helpers could be removed? |
T-Gro
left a comment
There was a problem hiding this comment.
🤖 This review was generated by AI (@expert-reviewer agent). Findings may contain inaccuracies — please verify independently.
Assessment: no significant issues found — this is a clean, behaviour-preserving test refactoring.
Verified the two highest-risk migrations line by line:
- Symbols
Nested copy-and-update: the 8{caretN}markers map 1:1, in order, to the 8 original per-Fact(name, ((line,col),(line,col)))cases. Thelet nestedFuncsource line is byte-identical, so the hardcoded ranges still match the token positions.List.iter2over equal-length lists also guards against a miscounted marker (a length mismatch would throw and fail the test). - CurriedArguments.Regression (and the other collapsed Completion sources):
extractOrderedMarkedSources(Checker.fs) sorts markers by Id and re-emits each source with only its own single caret, so each generated source is identical to the corresponding originalInlineDatasingle-caret source; the expected-names list preserves the original per-case expectations.
The remaining changes just drop now-redundant (*loc-N*) anchor comments and unused open System, with assertions untouched. Confirmed SourceContext.extractOrderedMarkedSources exists and behaves as assumed. No correctness/security/perf/error-handling concerns apply to this change.
Resolve conflicts by keeping the branch's dependency-only diff: reject PR #20082's multi-caret marker test refactoring (removed from Checker.fs on this branch), keeping the deleted FCS test files removed and Symbols.fs at the branch version. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Follow-up to #20033, building on @auduchinok's #20077. Adopts the ordered multi-caret / selection markers (
SourceContext.extractOrderedMarkedSources+{selstart}/{selend}) to remove copy-pasted test sources and magic coordinates.No behaviour change — every migrated test keeps identical assertions (each commit rubber-duck-verified byte-for-byte; tests green on net472 + net10.0).
Reductions:
open System+ now-redundant caret-anchor(*loc-N*)commentsArraySliceNotation(3 source copies → 1),CurriedArguments(5 → 1),Bug312557_2(4 → 1),Bug69673_1(2 → 1)Nested copy-and-update(8 Facts sharing a copied source → 1)((line,col),(line,col))tuples →{selstart}/{selend}markers in the sourceDeliberately not migrated (it would make the code worse, not better):
markAtStartOfMarker/markAtEndOfMarkeron a shared source — they already reuse the source, with heterogeneous asserts per position;{caretN}there is 0 reduction and messier.$/ direct-column low-level marker tests (IdentifierIsland, QuickParse, …) —$is more compact than{caret}; migrating adds indirection + a ±1 column risk for no reduction.