Assertions: Difference between revisions

Content deleted Content added
→‎{{header|F_Sharp|F#}}: Marked incomplete as the task asks for an assertion that an integer variable is equal to 42
Line 161: Line 161:


=={{header|F_Sharp|F#}}==
=={{header|F_Sharp|F#}}==
{{incomplete|F_Sharp|The task asks for an assertion that an integer variable is equal to 42.}}
F# provides an ''assert'' function that is only enabled when the program is compiled with ''DEBUG'' defined.
F# provides an ''assert'' function that is only enabled when the program is compiled with ''DEBUG'' defined.
<lang fsharp>let f x =
<lang fsharp>let f x =
assert (x > 1)
assert (x > 1)
x</lang>
x</lang>

=={{header|Go}}==
=={{header|Go}}==
<lang go>package main
<lang go>package main