I am writing a markdown compiler in Erlang for server-side use. Since I will need to work with clients, I decided to use the client side library (showdown.js) as a specification, and then check my code for compatibility with this.
In the first two iterations, I created 260-bit unit tests that checked that my program produced output that was compatible with what I considered a valid markdown based on reading the syntax note .
But now I'm trying to write a javascript program to create unit tests.
I have an input like:
"3 > 4\na"
I want to run an autopsy on it to get:
"<p>3 > 4\na</p>"
and I want to stitch this into EUnit statement:
"?_assert(conv(\"3 > 4\na\") == \"<p>3 > 4\na</p>\"),",
Erlang unit test. unit test, -, , javascript, , <textarea /> EUnit.
, \n , :
"?_assert(conv(\"3 > 4
a\") == \"<p>3 > 4
a</p>\"),",
, :
text.replace("\\", "\\\\");
text.replace("\n", "\\n");
...