Tests
Work-In-Progress
This page contains the current set of test fixtures for NeoDoc's parser. New tests are still being added as the work to extract the parser from the static site builder its embedded in continues.
When NeoDoc parses content it returns an AST. Each portion consistes of a "container", a "type", a "subtype", and a "template".
The tests are strcutred using the container, type, and subtype for the trees. The template level is taken up with "err", "err-batch", "ok", and "ok-batch" details that for the result from a given test. (The "-batch" versions come from supplemental test generators.)
Each tests displays a given input string, the expected AST output.
NeoDoc provides default HTML outputs. The expected output for each given input is displayed as well.
The full json fixture for each tests is also available below the HTML.
Emphasis
Currently, the content/shorthand/emphasis/ok portion of the tree has the most tests. It'll give you an idea of where things are headed.
The Tests
block
paragraph
normal
ok
P block - single line
full json fixture
content
shorthand
code
ok
Single word in shorthand: code
full json fixture
emphasis
err
Empty line (\n\n) fails
ERROR
full json fixture
Empty line (\r\n\r\n) fails
ERROR
full json fixture
End of file (eof) fails
ERROR
full json fixture
ok
End at empty line (\r\n\r\n): emphasis
full json fixture
End at empty line (\n\n\n\n): emphasis
full json fixture
Leading space is trimmed: emphasis
full json fixture
Leading spaces and single newlines (\n) are trimmed: emphasis
full json fixture
Leading spaces and single newlines (\r\n) are trimmed: emphasis
full json fixture
Multiple attrs and flags in shorthand: emphasis
full json fixture
Multiple attrs in shorthand: emphasis
full json fixture
Multiple flags in shorthand: emphasis
full json fixture
Multiple words on multiple lines: emphasis
full json fixture
Multiple words on single line: emphasis
full json fixture
Non-ASCII characters
full json fixture
Section/attribute tokens are valid: emphasis
full json fixture
Escaped backslash is valid: emphasis
full json fixture
Single windows newlines (\r\n) padded by spaces are merged to a single space: emphasis
full json fixture
Single newlines (\n) padded by spaces are merged to a single space: emphasis
full json fixture
Single windows newlines (\r\n) convert to a space: emphasis
full json fixture
Single newline (\n) converts to a space: emphasis
full json fixture
Single word with attr in shorthand: emphasis
full json fixture
Single word with flag in shorthand: emphasis
full json fixture
Single word in shorthand: emphasis
full json fixture
Trailing space is trimmed: emphasis
full json fixture
Trailing spaces and single newline is trimmed: emphasis
full json fixture
Whitespace around metadata pipes in shorthand: emphasis
full json fixture
URL flag in shorthand: emphasis
full json fixture
Escaped colon at end of flag in shorthand: emphasis
full json fixture
Escaped colon in shorthand text: emphasis
full json fixture
Escaped characters in shorthand text: emphasis
full json fixture
Escaped characters in shorthand flag: emphasis
full json fixture
Escaped characters in shorthand flag: emphasis
full json fixture
Nest another shorthand: emphasis
full json fixture
ok-batch
Escaped inline shorthand character: emphasis - `
full json fixture
Escaped inline shorthand character: emphasis - ;
full json fixture
Escaped inline shorthand character: emphasis - ^
full json fixture
Escaped inline shorthand character: emphasis - @
full json fixture
Escaped inline shorthand character: emphasis - %
full json fixture
Escaped inline shorthand character: emphasis - +
full json fixture
Escaped inline shorthand character: emphasis - >
full json fixture
Escaped inline shorthand character: emphasis - !
full json fixture
Escaped inline shorthand character: emphasis - ~
full json fixture
Escaped inline shorthand character: emphasis - *
full json fixture
Escaped inline shorthand character: emphasis - _
full json fixture
Single inline shorthand character: emphasis
full json fixture
Single inline shorthand character: emphasis
full json fixture
Single inline shorthand character: emphasis
full json fixture
Single inline shorthand character: emphasis
full json fixture
Single inline shorthand character: emphasis
full json fixture
Single inline shorthand character: emphasis
full json fixture
Single inline shorthand character: emphasis
full json fixture
Single inline shorthand character: emphasis
full json fixture
Single inline shorthand character: emphasis
full json fixture
Single inline shorthand character: emphasis
full json fixture
footnote
ok
Single word in shorthand: footnote
full json fixture
footnote_target
ok
Single word in shorthand: footnote_target
full json fixture
image
ok
Single image shorthand with alt text: image
ERROR
full json fixture
Single image shorthand: image
full json fixture
link
ok
Single word in shorthand: link
full json fixture
mark
ok
Single word in shorthand: mark
full json fixture
strike
ok
Single word in shorthand: strike
full json fixture
strong
ok
Single word in shorthand: strong
full json fixture
underline
ok
Single word in shorthand: underline
full json fixture
text
escaped
ok-batch
Shorthand escaped character at eof: code
full json fixture
Shorthand escaped character at eof: emphasis
full json fixture
Shorthand escaped character at eof: footnote_link
full json fixture
Shorthand escaped character at eof: footnote_return
full json fixture
Shorthand escaped character at eof: image
full json fixture
Shorthand escaped character at eof: kbd
full json fixture
Shorthand escaped character at eof: link
full json fixture
Shorthand escaped character at eof: mark
full json fixture
Shorthand escaped character at eof: strike
full json fixture
Shorthand escaped character at eof: strong
full json fixture
Shorthand escaped character at eof: underline
full json fixture
normal
err
Empty line (\n) fails
ERROR
full json fixture
Empty line (\r\n) fails
ERROR
full json fixture
End of file (eof) fails
ERROR
full json fixture
err-batch
Shorthand tag fails: code
ERROR
full json fixture
Shorthand tag fails: emphasis
ERROR
full json fixture
Shorthand tag fails: footnote_link
ERROR
full json fixture
Shorthand tag fails: footnote_return
ERROR
full json fixture
Shorthand tag fails: image
ERROR
full json fixture
Shorthand tag fails: kbd
ERROR
full json fixture
Shorthand tag fails: link
ERROR
full json fixture
Shorthand tag fails: mark
ERROR
full json fixture
Shorthand tag fails: strike
ERROR
full json fixture
Shorthand tag fails: strong
ERROR
full json fixture
Shorthand tag fails: underline
ERROR