27 lines
635 B
Plaintext
27 lines
635 B
Plaintext
|
# Docstring Tests
|
||
|
|
||
|
func main():
|
||
|
# Docstring tests begin with `>>` and can
|
||
|
# be used to check that a value is what you
|
||
|
# expected it to be:
|
||
|
|
||
|
>> 1 + 1
|
||
|
= 2
|
||
|
|
||
|
# If you don't provide an expected value,
|
||
|
# the expression will just be printed out
|
||
|
# and not checked:
|
||
|
>> 2 + 3
|
||
|
|
||
|
# If a docstring test's output is different
|
||
|
# from what was expected, it will print an
|
||
|
# error message and halt the program.
|
||
|
|
||
|
# Edit this test so it passes:
|
||
|
>> 2 + 2
|
||
|
= 9999
|
||
|
|
||
|
# For the rest of this tutorial, you won't
|
||
|
# be editing any of the tests, you'll be
|
||
|
# fixing code so it passes the tests.
|