Slide 10
Slide 10 text
function
add($a,
$b)
{
return
$a
+
$b;
}
function
testAdd()
{
$cases
=
array(array(0,
0,
0),
array(4,
2,
6),
array(8,
-‐1,
7));
foreach
($cases
as
$case)
{
list($a,
$b,
$c)
=
$case;
assert('add($a,
$b)
===
$c');
}
}
A Simple
Example