extract direct paths
This commit is contained in:
parent
77f70490df
commit
c36fece776
4 changed files with 104 additions and 3 deletions
|
@ -37,4 +37,71 @@ in
|
|||
};
|
||||
};
|
||||
})
|
||||
(it "extracts top level paths" {
|
||||
actual = getPaths {
|
||||
something = "";
|
||||
src = ./src/index.md;
|
||||
};
|
||||
expected = {
|
||||
"index.md" = ./src/index.md;
|
||||
};
|
||||
})
|
||||
(it "extracts lower level paths" {
|
||||
actual = getPaths {
|
||||
something = "yes";
|
||||
a-list = [
|
||||
{thingy = ./src/index.md;}
|
||||
[(html.tag "img" {src = ./src/favicon.png;} "")]
|
||||
];
|
||||
};
|
||||
expected = {
|
||||
"index.md" = ./src/index.md;
|
||||
"favicon.png" = ./src/favicon.png;
|
||||
};
|
||||
})
|
||||
(it "switches paths" {
|
||||
actual = switchPaths {
|
||||
something = "";
|
||||
a-thing = {
|
||||
src = ./src/index.md;
|
||||
};
|
||||
a-list = [
|
||||
{thingy = ./src/index.md;}
|
||||
];
|
||||
};
|
||||
expected = {
|
||||
something = "";
|
||||
a-thing = {
|
||||
src = "/static/index.md";
|
||||
};
|
||||
a-list = [
|
||||
{thingy = "/static/index.md";}
|
||||
];
|
||||
};
|
||||
})
|
||||
|
||||
(it "extracts paths" {
|
||||
actual = extractPaths {
|
||||
something = "";
|
||||
a-thing = {
|
||||
src = ./src/index.md;
|
||||
};
|
||||
a-list = [
|
||||
{thingy = ./src/index.md;}
|
||||
];
|
||||
};
|
||||
expected = {
|
||||
something = "";
|
||||
a-thing = {
|
||||
src = "/static/index.md";
|
||||
};
|
||||
a-list = [
|
||||
{thingy = "/static/index.md";}
|
||||
];
|
||||
static = {
|
||||
"index.md" = ./src/index.md;
|
||||
};
|
||||
};
|
||||
})
|
||||
|
||||
]
|
||||
|
|
BIN
testing/src/favicon.png
Normal file
BIN
testing/src/favicon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Loading…
Add table
Add a link
Reference in a new issue