28 lines
831 B
Nix
28 lines
831 B
Nix
let
|
|
md = import ../nixite/md.nix;
|
|
elems = import ../nixite/elems.nix;
|
|
it = import ./it.nix;
|
|
in
|
|
with md; [
|
|
(assert heading "# heading 1" == ["#" "heading 1"]; "echo gets heading 1")
|
|
(assert heading "## subheading" == ["##" "subheading"]; "echo gets heading 2")
|
|
(assert heading "some paragraph" == null; "echo paragraph is heading 0")
|
|
|
|
(assert mdBlock "# heading 1" == elems.h 1 "heading 1"; "echo makes h1 tag")
|
|
(assert mdBlock "## subheading" == elems.h 2 "subheading"; "echo makes h2 tag")
|
|
(assert mdBlock "some paragraph" == elems.p {} "some paragraph"; "echo makes p tag")
|
|
|
|
(it "processes md block" {
|
|
actual = readMd ''
|
|
# foo bar
|
|
|
|
lorem ipsum
|
|
'';
|
|
expected = [
|
|
(elems.h 1 "foo bar")
|
|
""
|
|
(elems.p {} "lorem ipsum\n")
|
|
];
|
|
})
|
|
]
|