1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2009 - DIGITEO
5 // This file is distributed under the same license as the Scilab package.
6 // =============================================================================
7 function [] = check_history(expected)
9 // ignore first line of history which indicates the current session
11 assert_checkequal(actual, expected);
13 // checking removing simple lines
15 // warning: a session line will be added at the front of this history
21 check_history(['lineB';'lineC';'lineD']);
24 check_history(['lineB';'lineD']);
27 check_history(['lineB']);
30 // check removing of session lines
32 // warning: a session line will be added at the front of this history
33 expected_history = ["// -- 26/02/2013 10:00:00 -- //";
36 "// -- 26/02/2013 11:00:00 -- //";
38 "// -- 26/02/2013 12:00:00 -- //";
39 "// -- 26/02/2013 13:00:00 -- //"];
40 addhistory(expected_history);
42 expected_history(1:3,1) = [];
43 check_history(expected_history);
45 expected_history(3,1) = [];
46 check_history(expected_history);
48 expected_history(3,1) = [];
49 check_history(expected_history);
51 expected_history(1:2,1) = [];
52 check_history(expected_history);
53 // check error messages
55 ierr = execstr("removelinehistory(10)", "errcatch");
56 assert_checkequal(ierr, 999);