source: git/Tst/Old/if.tst @ bf919a

fieker-DuValspielwiese
Last change on this file since bf919a was 46976a6, checked in by Olaf Bachmann <obachman@…>, 26 years ago
* added status check to regress.cmd * added tst_status(1); call to each tst file, just before quit git-svn-id: file:///usr/local/Singular/svn/trunk@2271 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 1.4 KB
Line 
1if (1)
2{
3"if branch if(1)";
4}
5else
6{
7"else branch if(1)";
8};
9// ====================================================
10if (1)
11{
12"if branch if(1) without else";
13}
14int i;
15else
16{
17"else branch without if";
18};
19// ====================================================
20if (0)
21{
22"if branch if(0)";
23}
24else
25{
26"else branch if(0)";
27};
28// ====================================================
29if (0)
30{
31"if branch if(0) without else";
32}
33int j;
34else
35{
36"else branch without if";
37};
38// ====================================================
39if(0)
40{
41  if(0)
42  {
43     "wrong 0 0: if if";
44  }
45  else
46  {
47     "wrong 0 0: if else";
48   };
49}
50else
51{
52  if(0)
53  {
54     "wrong 0 0: else if";
55  }
56  else
57  {
58     "nested if 0 0";
59  };
60};
61// ====================================================
62if(0)
63{
64  if(1)
65  {
66     "wrong 0 1: if else";
67  }
68  else
69  {
70     "wrong 0 1: if if";
71   };
72}
73else
74{
75  if(1)
76  {
77     "nested if 0 1";
78  }
79  else
80  {
81     "wrong 0 1: else else";
82   };
83}
84// ====================================================
85if(1)
86{
87  if(0)
88  {
89     "wrong 1 0: if if";
90  }
91  else
92  {
93     "nested if 1 0";
94  };
95}
96else
97{
98  if(0)
99  {
100     "wrong 1 0: else if";
101  }
102  else
103  {
104     "wrong 1 0: else else";
105   };
106}
107// ====================================================
108if(1)
109{
110  if(1)
111  {
112     "nested if 1 1";
113  }
114  else
115  {
116     "wrong 1 1: if else";
117   };
118}
119else
120{
121  if(1)
122  {
123     "wrong 1 1: else if";
124  }
125  else
126  {
127     "wrong 1 1: else else";
128   };
129}
130LIB "tst.lib";tst_status(1);$
Note: See TracBrowser for help on using the repository browser.