1// =============================================================================
2// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3// Copyright (C) 2010 - INRIA - Serge Steer
4// Copyright (C) 2010 - DIGITEO - Allan CORNET
5//
6//  This file is distributed under the same license as the Scilab package.
7// =============================================================================
8
9// <-- Non-regression test for bug 7805 -->
10//
11// <-- CLI SHELL MODE -->
12//
13// <-- INTERACTIVE TEST -->
14
15// <-- Bugzilla URL -->
16// http://bugzilla.scilab.org/show_bug.cgi?id=7805
17//
18// <-- Short Description -->
19// clear called inside an exec while in pause may have unexpected results
20
21//copy an paste the following instructions in the Scilab Console.
22
23// pause level must be 0 (-->)
24mputl("clear;", TMPDIR + "/bug7805.sce");
25a = 1
26
27pause
28// pause level must be 1 (-1->)
29b = 2
30pause
31
32// pause level must be 2 (-2->)
33c = 3
34
35
36exec(TMPDIR+"/bug7805.sce");
37
38// clear executed in pause level 2 then only c is cleared
39if exists("c") == 1 then pause,end
40
41// check that 'a' and 'b' exist
42if exists("b") == 0 then pause, end
43if exists("a") == 0 then pause, end
44
45resume
46// pause level must be 1 and b was defined in pause level 2
47if exists("b") == 1 then pause, end
48
49resume
50// pause level must be 0 only a exists
51if exists("a") == 0 then pause, end
52
53