1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2007-2008 - INRIA - Bruno JOFRET <bruno.jofret@inria.fr>
4//
5//  This file is distributed under the same license as the Scilab package.
6// =============================================================================
7// <-- CLI SHELL MODE -->
8// =============================================================================
9// Unitary tests for mputl function
10// =============================================================================
11ierr = execstr('mputl()','errcatch');
12if ierr<>999 then bugmes();quit;end
13ierr = execstr('mputl(1)','errcatch');
14if ierr<>999 then bugmes();quit;end
15// TEST 1 : dummy file
16cd TMPDIR;
17// Deleting an existing file... Just in case...
18mdelete("dummyFile.dummy")
19TXT = [ 'I am a dummy String'; ..
20        'Multi lines '; ..
21        'to check that'; ..
22        ' mputl is okay'; ..
23        ' on linux and windows ... '];
24r = mputl(TXT, 'dummyFile.dummy');
25if r <> %T then bugmes();quit;end
26TXT2 = mgetl('dummyFile.dummy');
27if TXT2 <> TXT then bugmes();quit;end
28// =============================================================================
29// Testing if the file created exists
30lsResult = ls("dummyFile.dummy");
31if lsResult == []      then bugmes();quit;end
32// Now delete it
33mdelete("dummyFile.dummy")
34// =============================================================================
35ierr = execstr('mputl(TXT, 5)','errcatch');
36if ierr <> 999 then bugmes();quit;end
37