Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4ede5f2

Browse files
committed
two more test cases for paradup
1 parent 15e93bd commit 4ede5f2

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

tests/test_linklint.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,46 @@ def test_nofix_self_link(rst: str, issues: list[LintIssue], diff: str) -> None:
666666
LintIssue(line=2, message="duplicate :class:`BaseException` in paragraph", fixed=False)
667667
],
668668
),
669+
lint_test_case(
670+
id="paragraphs",
671+
rst="""
672+
1 Multiple links to :class:`Something` in the same paragraph about
673+
:class:`Something` are not a problem, but they do create multiple
674+
LintIssues on different lines about :class:`Something`.
675+
676+
5 If :class:`!Something` is referenced
677+
but not linked, then :class:`Something` could
678+
be the first link to :class:`Something` and the other links
679+
to :class:`Something` are duplicates.
680+
""",
681+
issues=[
682+
LintIssue(line=2, message="duplicate :class:`Something` in paragraph", fixed=False),
683+
LintIssue(line=3, message="duplicate :class:`Something` in paragraph", fixed=False),
684+
LintIssue(line=7, message="duplicate :class:`Something` in paragraph", fixed=False),
685+
LintIssue(line=8, message="duplicate :class:`Something` in paragraph", fixed=False),
686+
],
687+
),
688+
lint_test_case(
689+
id="lists",
690+
rst="""
691+
Some lists:
692+
693+
- 3 Multiple links to :class:`Something` in the same paragraph about
694+
:class:`Something` are not a problem, but they do create multiple
695+
LintIssues on different lines about :class:`Something`.
696+
697+
- 7 If :class:`!Something` is referenced
698+
but not linked, then :class:`Something` could
699+
be the first link to :class:`Something` and the other links
700+
to :class:`Something` are duplicates.
701+
""",
702+
issues=[
703+
LintIssue(line=4, message="duplicate :class:`Something` in paragraph", fixed=False),
704+
LintIssue(line=5, message="duplicate :class:`Something` in paragraph", fixed=False),
705+
LintIssue(line=9, message="duplicate :class:`Something` in paragraph", fixed=False),
706+
LintIssue(line=10, message="duplicate :class:`Something` in paragraph", fixed=False),
707+
],
708+
),
669709
]
670710

671711

0 commit comments

Comments
 (0)