Jump to content

Assertions: Difference between revisions

Tweak irregular header markup
m (→‎{{header|Phix}}: added syntax colouring, assert() is now a builtin)
(Tweak irregular header markup)
Line 281:
<!--Putting the languages together for once to avoid duplicating the passage.-->
 
=={{header|C sharp|C#}} and {{header|Visual Basic .NET}}==
 
.NET provides the Debug.Assert and Trace.Assert methods, which notify TraceListener instances subscribed to the program's trace output if the specified condition is false. Both methods also have overloads that allow a specified string to be added to the default message of the assertion, which consists of "Assertion Failed" and a stack trace for the location of the assertion.
Line 1,175:
<lang Mathematica>Assert[var===42]</lang>
 
=={{header|MATLAB}} / {{header|Octave}} ==
 
<lang MATLAB>assert(x == 42,'x = %d, not 42.',x);</lang>
10,333

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.