1 // =============================================================================
2 // Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 // Copyright (C) 2019, 2020 - Samuel GOUGEON
5 // This file is distributed under the same license as the Scilab package.
6 // =============================================================================
8 // Unitary tests of default display of scalar (nested) structures
9 // =============================================================================
11 // <-- CLI SHELL MODE -->
12 // <-- ENGLISH IMPOSED -->
14 oldDepth = xmlGetValues("//general/body/environment","container_disp_max_depth");
15 xmlSetValues("//general/body/environment", ["container_disp_max_depth"; "3"]);
17 // ----------------------------------------------------------------
19 s.f = [%i/%s, %s/(1-%s), 1/(1-%s)^2];
20 s.c = {1 3 ; "abc" %z};
25 s.L = list(rand(2,3),{},(1-%z)^3,,%pi, %t, "abcd");
27 s.tlist = tlist(["myTlist" "bool" "int" "num" "txt" "list"],..
28 rand(3,4,2)<0.5, int8((rand(3,5)-0.5)*200), ..
29 grand(3,4,"uin",-100,100), ["This" "is" "a" "test"], list(%pi,"number"));
30 s.mlist = mlist(["myMlist" "spb" "fun" "pol" "txt"],..
31 sparse(rand(3,4)<0.5), cosd, (1-%z).^(0:4),["Scilab" "6.1"]);
33 s.withVoid = struct("num",%pi,"v",,"t","text");
34 s.struct = struct("a",rand(1,3),"L",list(%e,,"ABC"),"c",{{"GHI",1234}});
37 // ----------------------------------------------------------------
40 s.L = list(2,"bonjour", list(%i, list(%z,3)));
43 s.t.tl = tlist(["myTlist" "a" "b" "c"], rand(2,3), %t, list("abc", 123));
46 s.t.L2 = list("Hello", list(1-%z+%z^2, list(-4,%t)));
47 s.t.b.s.a = "Level 3";
50 xmlSetValues("//general/body/environment", ["container_disp_max_depth";"0"]);
52 xmlSetValues("//general/body/environment", ["container_disp_max_depth";"1"]);
54 xmlSetValues("//general/body/environment", ["container_disp_max_depth";"2"]);
56 xmlSetValues("//general/body/environment", ["container_disp_max_depth";"3"]);
58 // ----------------------------------------------------------------
60 xmlSetValues("//general/body/environment", ["container_disp_max_depth"; oldDepth]);