Add a error message when get_function_path has not input argument and fix test win...
[scilab.git] / scilab / modules / functions / tests / unit_tests / get_function_path.tst
1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2013 - Scilab Enterprises - Charlotte HECQUET
4 //
5 //  This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7
8 // <-- CLI SHELL MODE -->
9
10 // unit tests for get_function_path() function
11 // =============================================================================
12
13 assert_checkequal(get_function_path('abcd'), pathconvert(getlongpathname(SCI+'/modules/cacsd/macros/abcd.sci'), %f));
14 assert_checkequal(get_function_path('dae'), pathconvert(getlongpathname(SCI+'/modules/differential_equations/macros/dae.sci'), %f));
15 assert_checkequal(get_function_path('acosd'), pathconvert(getlongpathname(SCI+'/modules/elementary_functions/macros/acosd.sci'), %f));
16 assert_checkequal(get_function_path('dir'), pathconvert(getlongpathname(SCI+'/modules/fileio/macros/dir.sci'), %f));
17 assert_checkequal(get_function_path('get_function_path'), pathconvert(getlongpathname(SCI+'/modules/functions/macros/get_function_path.sci'), %f));
18 assert_checkequal(get_function_path('get_param'), pathconvert(getlongpathname(SCI+'/modules/parameters/macros/get_param.sci'), %f));
19 assert_checkequal(get_function_path('median'), pathconvert(getlongpathname(SCI+'/modules/statistics/macros/median.sci'), %f));
20 assert_checkequal(get_function_path('calendar'), pathconvert(getlongpathname(SCI+'/modules/time/macros/calendar.sci'), %f));
21
22 assert_checkequal(get_function_path('eigs.sci'),[]);
23 assert_checkfalse(execstr("get_function_path()","errcatch")==0);
24 refMsg = msprintf(_("%s: Wrong number of input argument: %d expected.\n"), "get_function_path", 1);
25 assert_checkerror("get_function_path()", refMsg);
26 assert_checkfalse(execstr("get_function_path(eigs)","errcatch")==0);
27 refMsg = msprintf(_("%s: Wrong type for input argument #%d: A string expected.\n"),"get_function_path",1);
28 assert_checkerror("get_function_path(eigs)", refMsg);