Test first LOLCODE
Introduction
This is a section for creating unit tests and other language-exercisers. These will not be actual pieces of code, but rather snippets of code & their expected results. They are intended to be implemented and run by an implementor of a language to help ensure that their implementation is valid. In addition, they will help serve to flesh out existing specs, providing detail on corner cases.
Each set of tests will be linked to a spec version, and will reflect the expected results for that version. As the language grows, the tests will be copied and updated for each new version.
Process
To add a test: - Determine a test that would be useful and that isn't already covered by an existing test. - Add the test to the list of tests with the following format:
<expected result>: <LOLCODE snippet>
For example:
true: SAEM BOTH 2 AN 2 false: SAEM BOTH 2 AN 3 4: SUM OF 2 AN 2 error (unterminated string): VISIBLE "NO CLOSING QUOTE
- If you aren't sure of the result, but you think it needs defined, indicate with something like “not sure” or “unknown” For example:
not sure?:SAEM BOTH 2 AN "2.0"
LOLCODE v1.2
Formatting
The following is a test of the formatting rules.
This is a line
This is "the \"second\" line" BTW this is invisible
This is the ...
third line
This ...
is ...
...
the fourth line
This is the fifth line,this is the sixth line
This "is the BTW seventh line, and its all on one..." line BTW this is, well, removed ...
This is line eight
OBTW this is a long
multiline
comment TLDR
This is line nine
According to the formatting rules the … should concatenate lines and , should separate them. Also, comments should be removed. After running the above code through a formatting filter, it should return this:
This is a line This is "the \"second\" line" This is the third line This is the fourth line This is the fifth line this is the sixth line This "is the BTW seventh line, and its all on one..." line This is line eight Thsi is line nine