Skip to content

Commit 4994243

Browse files
authored
fixes fusion tests (#104)
* fixes fusion tests * fixes headings
1 parent 39a9fcc commit 4994243

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/fusion/matching.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ subpatterns or have trailing ``.._`` in pattern.
243243
============= ============== ==============
244244

245245
Use examples
246-
~~~~~~~~~~~~
246+
############
247247

248248
- capture all elements in sequence: ``[all @elems]``
249249
- get all elements until (not including "d"): ``[until @a is "d"]``
@@ -419,7 +419,7 @@ Predicates and infix operators
419419
------------------------------
420420

421421
Infix operators
422-
~~~~~~~~~~~~~~~
422+
###############
423423

424424
By default object fields are either matched using recursive pattern, or
425425
compared for equality (when ``field: "some value"`` is used). It is also
@@ -437,7 +437,7 @@ visible in the case branch.
437437

438438

439439
Custom predicates
440-
~~~~~~~~~~~~~~~~~
440+
#################
441441

442442
Matching expressions using custom predicates is also possible. If it is not
443443
necessary to capture matched element placeholder ``_.`` should be used as a

tests/tmatching.nim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -904,6 +904,9 @@ suite "Matching":
904904
text*: string
905905
subn*: seq[HtmlNode]
906906

907+
proc `==`(x, y: HtmlNode): bool {.noSideEffect.} =
908+
x.kind == y.kind and x.text == y.text and x.subn == y.subn
909+
907910
func add(n: var HtmlNode, s: HtmlNode) = n.subn.add s
908911

909912
func len(n: HtmlNode): int = n.subn.len

0 commit comments

Comments
 (0)