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

Laurent Heirendt's avatar
Laurent Heirendt committed
3
addpath(genpath('src/'))  % add this folder and all subfolders to the path
4

Laurent Heirendt's avatar
Laurent Heirendt committed
5
c = addTwoNumbers_myName(1, 2)
6

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

Laurent Heirendt's avatar
Laurent Heirendt committed
10
d = multiplyTwoNumbers_myName(c, c)
11

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

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