test_myName.m 357 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
% test if the addition function works as expected
Laurent Heirendt's avatar
Laurent Heirendt committed
8
%assert(c == 3)
Laurent Heirendt's avatar
Laurent Heirendt committed
9

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

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

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