Template:Code/testcases

Live version Template:Code

... ...

Most HTML elements are enclosed between a start tag and an end tag, such as .... Some are not, such as.

Sandbox version Template:Code/sandbox

Most HTML elements are enclosed between a start tag and an end tag, such as. Some are not, such as.

Font Size
Fontsize in FF:
 * Plain
 * Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.


 * code
 * Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.


 * code/sandbox


 * 


 * syntaxhighlight


 * font-family&#x3a;monospace; only
 * Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

Misc tests
Spaces between proportional and monospaced segments are (depending on browser) precisely or very close to precisely the same as the spaces between characters inside the monospaced segment (which are necessarily larger than those between characters in the proportional segments).
 * Sandbox code:
 * Foo bar baz quux.
 * Foo bar baz quux.
 * Measure me: ! ! ! !

Spaces between proportional and monospaced segments are (depending on browser) farcically smaller than the spaces between characters inside the monospaced segment, making the content weird-looking and hard to parse.
 * Old code:
 * Foo bar fee fi fo fum baz quux.
 * Foo bar blah blah blah baz quux.
 * Measure me: ! ! ! ! ! !

Blow up your font size to twice normal or so, and get out a ruler.
 * Comparisons:
 * Measure me: ! ! ! ! ! !  (intentionally wider padding to match wider monospacing)
 * Measure me: ! ! ! ! ! !
 * Measure me: ! ! ! ! ! !
 * Measure me: ! ! ! !
 * Measure me: ! ! ! ! ! !
 * Measure me: ! !  ! !

For cases where the padding left or right is undesirable, use n or n (or any other value, like 'no" or "0", with either parameter:


 * Measure me: ! ! ! !
 * Measure me: ! ! ! !
 * Measure me: ! ! ! !
 * Measure me: ! ! ! !
 * Measure me: ! ! ! ! ! !
 * Measure me: ! ! ! ! ! !
 * Measure me: ! ! ! ! ! !
 * Measure me: ! ! ! ! ! !

lang tests

 * Test cases


 * The declaration int foo(const std::string& bar, const std::vector& baz); is the prototype for a function defined later.
 * If the code contains an equals sign, such as ...
 * The following is an example of a main method in Java: public static void main(string[] args){ System.out.println("Hello world!"); }
 * The following is an example of a main method in Java: public static void main(string[] args){ System.out.println("Hello world!"); }


 * The declaration is the prototype for a function defined later.
 * If the code contains an equals sign, such as ...
 * The following is an example of a main method in Java:
 * The following is an example of a main method in Java: