···1414proc main!() {
1515 loop {
1616 let inputNumber = Int readline!()
1717- when 'EOF cancel break # done
1717+ when 'EOF cancel break # done
1818 when 'NAN cancel #- default when invalid: -# 0
1919 println!(double inputNumber)
2020 }
+12
spec/src/overview/additional-features/index.tex
···9494author desires, but more importantly, can exported locally alongside the
9595documentation of all other referenced code, so it can be found in a
9696predictable location alongside any project that uses it.
9797+9898+\subsubsection{Testing}
9999+100100+Tests are defined similarly to procedures, but using the keyword \kw{test}
101101+instead of \kw{proc}. A test is run as if it was the entrypoint to the
102102+application. If execution reaches the end successfully, the test is
103103+considered a success; otherwise it is a failure.
104104+105105+\inputcode{tests.tri}
106106+107107+To make tests easier to write, the \kw{assert} keyword will abort the
108108+current process when its parameter does not evaluate to \val{true}.
+10
spec/src/overview/additional-features/tests.tri
···11+func double x = x * 2
22+func triple x = x * 4 # uh oh
33+44+test can_double!() {
55+ assert double 2 == 4
66+}
77+88+test can_triple() {
99+ assert triple 2 == 6
1010+}