Tests: Difference between revisions

24 bytes removed ,  29 November 2011
m
fixing headers level
(created page and moved stuff from [Tips and tricks])
 
m (fixing headers level)
Line 1: Line 1:
= Tests =
Writing tests for function is an important thing that is usually overlooked. It helps a lot in preventing regression.
Writing tests for function is an important thing that is usually overlooked. It helps a lot in preventing regression.


== Writing tests ==
= Writing tests =
=== in .m files ===
== in .m files ==
=== in .cc files ===
== in .cc files ==
===declaring functions inside a test block===
==declaring functions inside a test block==


  function experience
  function experience
Line 25: Line 24:
  %! % endfunction: don't add it here. Let test() do it.
  %! % endfunction: don't add it here. Let test() do it.


== running tests ==
= running tests =
=== from m files ===
== from m files ==
=== from .cc files ===
== from .cc files ==
You can run tests in .cc files by doing something like
You can run tests in .cc files by doing something like
   test /full/path/to/file.cc
   test /full/path/to/file.cc