mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00

... and enforce that defs can only occur in blocks (or, inside parenthesized expressions)
20 lines
645 B
Text
20 lines
645 B
Text
expect
|
|
html : Html {}
|
|
html =
|
|
Element "a" 43 [HtmlAttr "href" "https://www.roc-lang.org/"] [Text "Roc"]
|
|
|
|
actual : { nodes : List RenderedNode, siblingIds : List U64 }
|
|
actual =
|
|
indexNodes { nodes: [], siblingIds: [] } html
|
|
|
|
expected : { nodes : List RenderedNode, siblingIds : List U64 }
|
|
expected = {
|
|
nodes: [
|
|
RenderedText "Roc",
|
|
RenderedElement "a" { emptyRenderedAttrs & htmlAttrs: Dict.fromList [("href", "https://www.roc-lang.org/")] } [0],
|
|
],
|
|
siblingIds: [1],
|
|
}
|
|
|
|
(actual.nodes == expected.nodes)
|
|
&& (actual.siblingIds == expected.siblingIds)
|