test_diana.m 299 Bytes
Newer Older
1
2
% Test file

Diana HENDRICKX's avatar
Diana HENDRICKX committed
3
c = addTwoNumbers_diana(1, 2)
4

Laurent Heirendt's avatar
Laurent Heirendt committed
5
% test if the addition function works as expected
Diana HENDRICKX's avatar
Diana HENDRICKX committed
6
assert(c == 3)
Laurent Heirendt's avatar
Laurent Heirendt committed
7

Diana HENDRICKX's avatar
Diana HENDRICKX committed
8
d = multiplyTwoNumbers_diana(c, c)
9

Laurent Heirendt's avatar
Laurent Heirendt committed
10
% test if the multiplication function works as expected
Diana HENDRICKX's avatar
Diana HENDRICKX committed
11
assert(d == 9)
Laurent Heirendt's avatar
Laurent Heirendt committed
12

13
% Test for the homework
14
% test my sqrt function
Diana HENDRICKX's avatar
Diana HENDRICKX committed
15
assert(sqrt_diana(d) == sqrt(d))