Skip to content

Commit

Permalink
fix issue #177 some tests failed when it executed from a binary versi…
Browse files Browse the repository at this point in the history
…on on windows.
  • Loading branch information
Nelson-numerical-software committed Jan 2, 2019
1 parent 4f5209e commit f69290d
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 17 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Expand Up @@ -9,6 +9,9 @@ Features:
Bug Fixes:
---------


* [#177](http://github.com/Nelson-numerical-software/nelson/issues/177): some tests failed when it executed from a binary version on windows.

* [#176](http://github.com/Nelson-numerical-software/nelson/issues/176): nfilename did not return canonical path name in some cases.


Expand Down
6 changes: 4 additions & 2 deletions modules/core/tests/test_eval.nls
Expand Up @@ -41,12 +41,14 @@ assert_isequal(C, B);
D = eval('B;');
assert_isequal(D, B);
//=============================================================================
assert_checkerror('R = eval(''AA = 33'');', _('Expecting statement list or function definition'));
expected_msg = sprintf(_('Expecting %s'), _('statement list or function definition'));
assert_checkerror('R = eval(''AA = 33'');', expected_msg);
//=============================================================================
eval('AA = 33');
assert_isequal(AA, 33);
//=============================================================================
assert_checkerror('R = eval(''cos = 33;'');', _('Expecting statement list or function definition'));
expected_msg = sprintf(_('Expecting %s'), _('statement list or function definition'));
assert_checkerror('R = eval(''cos = 33;'');', expected_msg);
eval('cos = 33;');
assert_isequal(cos, 33);
//=============================================================================
Expand Down
3 changes: 2 additions & 1 deletion modules/core/tests/test_evalc.nls
Expand Up @@ -55,5 +55,6 @@ R = evalc('warning(''this a warning'')');
REF = 'this a warning';
assert_isequal(R, REF);
//=============================================================================
assert_checkerror('evalc(''A++'')', _('Expecting an expression after ''+'''));
expected_msg = sprintf(_('Expecting %s'), _('an expression after ''+'''));
assert_checkerror('evalc(''A++'')', expected_msg);
//=============================================================================
2 changes: 1 addition & 1 deletion modules/elementary_functions/tests/test_addition.nls
Expand Up @@ -50,7 +50,7 @@ assert_isequal(R, REF);
//=============================================================================
A = ones(1,2,3);
B = [1:3];
assert_checkerror('R = A + B;', _('Size mismatch on arguments to arithmetic operator +'));
assert_checkerror('R = A + B;', [_('Size mismatch on arguments to arithmetic operator '), '+']);
//=============================================================================
A = "r";
B = "B";
Expand Down
2 changes: 1 addition & 1 deletion modules/elementary_functions/tests/test_eq.nls
Expand Up @@ -31,7 +31,7 @@ assert_isequal(R, REF);
//=============================================================================
A = ["Nel", NaN, "son"];
B = ["Nel", "son"];
assert_checkerror('A == B', _('Size mismatch on arguments to arithmetic operator =='));
assert_checkerror('A == B', [_('Size mismatch on arguments to arithmetic operator '), '==']);
//=============================================================================
A = ["r", "rff", ""; "dd", "c", "mm"];
B = ["r", "rff", ""; "dd", "c", "mm"];
Expand Down
2 changes: 1 addition & 1 deletion modules/elementary_functions/tests/test_ge.nls
Expand Up @@ -31,7 +31,7 @@ assert_isequal(R, REF);
//=============================================================================
A = ["Nel", NaN, "son"];
B = ["Nel", "son"];
assert_checkerror('A >= B', _('Size mismatch on arguments to arithmetic operator >='));
assert_checkerror('A >= B', [_('Size mismatch on arguments to arithmetic operator '), '>=']);
//=============================================================================
R = ("" >= "r");
assert_isfalse(R);
Expand Down
2 changes: 1 addition & 1 deletion modules/elementary_functions/tests/test_le.nls
Expand Up @@ -31,7 +31,7 @@ assert_isequal(R, REF);
//=============================================================================
A = ["Nel", NaN, "son"];
B = ["Nel", "son"];
assert_checkerror('A <= B', _('Size mismatch on arguments to arithmetic operator <='));
assert_checkerror('A <= B', [_('Size mismatch on arguments to arithmetic operator '), '<=']);
//=============================================================================
R = ("" <= "r");
assert_istrue(R);
Expand Down
2 changes: 1 addition & 1 deletion modules/elementary_functions/tests/test_ne.nls
Expand Up @@ -31,7 +31,7 @@ assert_isequal(R, REF);
//=============================================================================
A = ["Nel", NaN, "son"];
B = ["Nel", "son"];
assert_checkerror('A != B', _('Size mismatch on arguments to arithmetic operator ~='));
assert_checkerror('A != B', [_('Size mismatch on arguments to arithmetic operator '), '~=']);
//=============================================================================
A = ["r", "rff", ""; "dd", "c", "mm"];
B = ["r", "rff", ""; "dd", "c", "mm"];
Expand Down
3 changes: 2 additions & 1 deletion modules/f2c/tests/test_f2c.nls
Expand Up @@ -23,7 +23,8 @@ REF_FILE = [modulepath(nelsonroot(),'f2c','root'), '/tests/dgemm.c'];
if isfile(DEST_FILE)
rmfile(DEST_FILE);
end
f2c([modulepath(nelsonroot(),'f2c','root'), '/tests/dgemm.f'], TEST_DIR);
copyfile([modulepath(nelsonroot(),'f2c','root'), '/tests/dgemm.f'], [TEST_DIR, '/dgemm.f'])
f2c([TEST_DIR, '/dgemm.f'], TEST_DIR);
DEST_FILE = [TEST_DIR, '/dgemm.c'];
assert_istrue(isfile(DEST_FILE));
R = fileread(DEST_FILE, 'char', 'native');
Expand Down
16 changes: 8 additions & 8 deletions modules/string/tests/test_char.nls
Expand Up @@ -145,17 +145,17 @@ REF = ['Hello ';
assert_isequal(R, REF);
//=============================================================================
assert_checkerror('char()', _('Wrong number of input arguments.'));
assert_checkerror('char(true)', [_('Undefined function ''char'' for input arguments of type '''), class(true), '''.']);
assert_checkerror('char(true)', [_('Undefined function ''char'' for input arguments of type'), ' ''', class(true), '''.']);
assert_checkerror('char([65i, 65])', _('Conversion to char from complex is not possible.'));
//=============================================================================
assert_checkerror('R = char([65, 66, 67], i)', _('Undefined function ''char'' for input arguments.'));
assert_checkerror('char({''test'', [115, 101, 116]})', [_('Undefined function ''char'' for input arguments of type '''), class({'test', [115, 101, 116]}), '''.']);
assert_checkerror('char({''test'', [115, 101, 116]})', [_('Undefined function ''char'' for input arguments of type'), ' ''', class({'test', [115, 101, 116]}), '''.']);
//=============================================================================
assert_checkerror('char({''of'', ''strings''; ''in'', 97})', [_('Undefined function ''char'' for input arguments of type '''), class({'test', [115, 101, 116]}), '''.']);
assert_checkerror('char({{''test''}})', [_('Undefined function ''char'' for input arguments of type '''), class({{'test'}}), '''.']);
assert_checkerror('char({{''test'', {}, ''string''}})', [_('Undefined function ''char'' for input arguments of type '''), class({}), '''.']);
assert_checkerror('char({''test'', {}, ''string''})', [_('Undefined function ''char'' for input arguments of type '''), class({}), '''.']);
assert_checkerror('char({''of'', ''strings''; ''in'', 97})', [_('Undefined function ''char'' for input arguments of type'), ' ''', class({'test', [115, 101, 116]}), '''.']);
assert_checkerror('char({{''test''}})', [_('Undefined function ''char'' for input arguments of type'), ' ''', class({{'test'}}), '''.']);
assert_checkerror('char({{''test'', {}, ''string''}})', [_('Undefined function ''char'' for input arguments of type'), ' ''', class({}), '''.']);
assert_checkerror('char({''test'', {}, ''string''})', [_('Undefined function ''char'' for input arguments of type'), ' ''', class({}), '''.']);
//=============================================================================
assert_checkerror('char({''test'', 256, ''test2''})', [_('Undefined function ''char'' for input arguments of type '''), class({}), '''.']);
assert_checkerror('char({''test'', [115, 101.1, 115.5], {''of'', ''in''; ''strings'', 96.9}, [99, 101; 108, 108], 97}, 114, [114; 97], ''y'')', [_('Undefined function ''char'' for input arguments of type '''), class({}), '''.']);
assert_checkerror('char({''test'', 256, ''test2''})', [_('Undefined function ''char'' for input arguments of type'), ' ''', class({}), '''.']);
assert_checkerror('char({''test'', [115, 101.1, 115.5], {''of'', ''in''; ''strings'', 96.9}, [99, 101; 108, 108], 97}, 114, [114; 97], ''y'')', [_('Undefined function ''char'' for input arguments of type'), ' ''', class({}), '''.']);
//=============================================================================

0 comments on commit f69290d

Please sign in to comment.