Jump to content

Test a function: Difference between revisions

Added Erlang
(Added Erlang)
Line 365:
# value: 131072</lang>
 
=={{header|Erlang}}==
This is a unit test so I use Eunit. For system tests "Common Test" would be used. Both are built in.
<lang Erlang>
-module( palindrome_tests ).
-compile( export_all ).
-include_lib( "eunit/include/eunit.hrl" ).
 
abcba_test() -> ?assert( palindrome:is_palindrome("abcba") ).
 
abcdef_test() -> ?assertNot( palindrome:is_palindrome("abcdef") ).
</lang>
{{out}}
<pre>
25> eunit:test(palindrome).
All 2 tests passed.
</pre>
 
=={{header|Euphoria}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.