-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
91 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{- SPDX-FileCopyrightText: 2019 Serokell <https://serokell.io> | ||
- | ||
- SPDX-License-Identifier: MPL-2.0 | ||
-} | ||
|
||
module Test.Xrefcheck.CopyPasteInListsSpec where | ||
|
||
import Universum | ||
|
||
import Test.Hspec (Spec, describe, it, shouldBe) | ||
|
||
import Test.Xrefcheck.Util | ||
import Xrefcheck.Core | ||
|
||
spec :: Spec | ||
spec = do | ||
describe "Possibly incorrect copy-paste" $ do | ||
for_ allFlavors $ \fl -> do | ||
it ("is detected (" <> show fl <> ")") $ do | ||
fi <- getFI fl "tests/markdowns/without-annotations/copy-paste_in_lists.md" | ||
getPasta fi `shouldBe`[("a", "c")] | ||
where | ||
getPasta :: FileInfo -> [(Text, Text)] | ||
getPasta fi = map (cpAnchorText &&& cpPlainText) $ fi ^. fiCopyPastes |
17 changes: 17 additions & 0 deletions
17
tests/markdowns/without-annotations/copy-paste_in_lists.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!-- | ||
- SPDX-FileCopyrightText: 2018-2019 Serokell <https://serokell.io> | ||
- | ||
- SPDX-License-Identifier: MPL-2.0 | ||
--> | ||
|
||
A list with bad copy-paste: | ||
|
||
- [a](a) e | ||
- [b](b) e | ||
- [c](a) e | ||
|
||
A list that is completely fine: | ||
|
||
- [a](a) d | ||
- [b](b) d | ||
- [c](c) d |