| Copyright | Copyright 2024 Ruifeng Xie |
|---|---|
| License | LGPL-3.0-or-later |
| Maintainer | Ruifeng Xie <ruifengx@outlook.com> |
| Safe Haskell | None |
| Language | GHC2021 |
Test.DocTest.FuzzyMatch
Description
Fuzzy matching logic used for doctest output text segments.
Documentation
match :: Pattern -> String -> Bool Source #
Match the String with the given Pattern.
- No wildcard:
>>>let pat = [Plain "some text\nwithout wildcard"]>>>pat `match` "some text\nwithout wildcard"True
- Inline wildcard:
>>>let pat = [Plain "some ", InlineDots, Plain " text"]>>>pat `match` "some single-line text"True>>>pat `match` "some\nmultiline\ntext"False
- Multiline wildcard:
>>>let pat = [Plain "some\n", MultilineDots, Plain "\ntext"]>>>pat `match` "some\nmultiline\ntext"True>>>pat `match` "some\n\ntext"True>>>pat `match` "some\nmulti\nline\ntext"True
- Blank line:
>>>let pat = [Plain "a blank\n", BlankLine, Plain "\nline"]>>>pat `match` "a blank\n\nline"True>>>pat `match` "a blank\n(not)\nline"False