test_myName.m 308 Bytes
Newer Older
1 2
% Test file

Laurent Heirendt's avatar
Laurent Heirendt committed
3
c = addTwoNumbers_myName(1, 2)
4

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

8
% d = multiplyTwoNumbers_myName(c, c)
9

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

13
% Test for the homework
14
% test my sqrt function
15
% assert(sqrt_myName(d) == sqrt(d))