Skip to content

LT-22672: Cover the relevance rule with the most rows riding on it - #1145

Draft
thejambi wants to merge 1 commit into
mainfrom
LT-22672-followup-relevance-tests
Draft

thejambi wants to merge 1 commit into
mainfrom
LT-22672-followup-relevance-tests

Conversation

@thejambi

@thejambi thejambi commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Adds the one composer test that was missing for the field-relevance gate, raised by
@jasonleenaylor after #1135 merged.

MoStemMsa.IsFieldRelevant withholds Attaches to Categories (FromPartsOfSpeech)
unless the owning entry has a proclitic or enclitic allomorph. Morphology.fwlayout
declares that part visibility="always", so before the relevance gate landed the row
composed on every stem MSA. That makes it the gate's most visible consequence, and it
was the only one of its rules with no test.

The test bites

It is Jason's test, run and falsified rather than taken on trust:

Gate suppressed negative half fails, Expected: False, But was: True
Gate restored passes, and the positive control passes throughout

The positive control adds a proclitic allomorph and changes nothing else, so the same
row on the same object is shown to appear as well as to vanish.

Also

Two comments claimed more than the code does, and are corrected:

  • IsIrrelevantForObject described itself as the whole of SliceFilter.IncludeSlice.
    It implements one of that method's two gates.
  • The test fixture said it covered the remainder of the IsFieldRelevant overrides,
    which was untrue while this test was missing. It now names the one limb still
    uncovered: the InflectionClass case that withholds the row from a compound rule's
    left or right MSA.

Verification

No behaviour change -- one test and two comments.

  • xWorksTests -TestFilter Avalonia: 1643 passed, 2 skipped, 0 failed
  • build.ps1 -CommentHygiene -TokenHygiene clean

The LexiconFirstSliceEditContextEdgeCaseTests teardown error in that run is
pre-existing and unrelated: Validate_WhitespaceOnlyLexeme_IsAnError stages an edit and
never commits or cancels it, so the unit-of-work write lock is still held when the cache
is disposed. git blame puts it in LT-22625 (#964). Nothing here touches that file.

🤖 Generated with Claude Code


This change is Reviewable

Raised by Jason on #1135, after the merge. MoStemMsa.IsFieldRelevant withholds
FromPartsOfSpeech ("Attaches to Categories") unless the owning entry has a
proclitic or enclitic, and Morphology.fwlayout:39 declares that part
visibility="always" -- so before the relevance gate the row composed on every
stem MSA, and now it disappears for every entry without a clitic. That is the
gate's most visible consequence and nothing pinned it.

The test is Jason's, run and confirmed to bite: suppressing the gate fails its
negative half with "Expected: False, But was: True", while the positive control
-- add a proclitic allomorph, change nothing else -- keeps passing.

Also corrects two comments that claimed more than the code does. The composer
implements the SECOND of SliceFilter.IncludeSlice's two gates; the first looks
the slice id up in the tool's filter list, and the id never reaches the
composer, so that half is LT-22802. The fixture summary said it covered the
remainder of the overrides, which was untrue while this test was missing, and
still excludes the InflectionClass limb that withholds the row from a compound
rule's left/right MSA.

xWorksTests filter Avalonia 1642 passed, 0 failed.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

NUnit Tests

    1 files  ±0      1 suites  ±0   13m 2s ⏱️ +39s
6 198 tests +1  6 113 ✅ +1  85 💤 ±0  0 ❌ ±0 
6 207 runs  +1  6 122 ✅ +1  85 💤 ±0  0 ❌ ±0 

Results for commit c03c95a. ± Comparison against base commit 2f1d9db.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.88%. Comparing base (2f1d9db) to head (c03c95a).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1145      +/-   ##
==========================================
- Coverage   38.89%   38.88%   -0.01%     
==========================================
  Files        1518     1518              
  Lines      352262   352262              
  Branches    40597    40597              
==========================================
- Hits       137005   136984      -21     
- Misses     185976   185997      +21     
  Partials    29281    29281              
Files with missing lines Coverage Δ
Src/xWorks/Avalonia/Composer/DetailComposer.cs 69.19% <ø> (ø)

... and 4 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants