test_myName.m 278 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

Laurent Heirendt's avatar
Laurent Heirendt committed
8
d = multiplyTwoNumbers_myName(c, c)
9

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

13
% test my sqrt function
Laurent Heirendt's avatar
Laurent Heirendt committed
14
assert(sqrt_myName(d) == sqrt(d))