~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to tests/strelm.dia.ref

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// Copyright INRIA
 
3
 
 
4
 
 
5
 
 
6
 
 
7
// length
 
8
 
 
9
if length('abd')<>3 then bugmes();quit;end
 
10
 
 
11
if length(emptystr())<>0 then bugmes();quit;end
 
12
 
 
13
if or(length(['abd';emptystr()])<>[3;0]) then bugmes();quit;end
 
14
 
 
15
if or(length(string(ones(10,10)))<>1) then bugmes();quit;end
 
16
 
 
17
 
 
18
//part
 
19
 
 
20
if part('abc',1)<>'a' then bugmes();quit;end
 
21
 
 
22
if part('abc',[1 1])<>'aa' then bugmes();quit;end
 
23
 
 
24
if part('abc',[1;1])<>'aa' then bugmes();quit;end
 
25
 
 
26
if part('abc',[])<>emptystr() then bugmes();quit;end
 
27
 
 
28
if part('abc',5)<>' ' then bugmes();quit;end
 
29
 
 
30
if part('abc',5:6)<>'  ' then bugmes();quit;end
 
31
 
 
32
if or(part(['abc';'x'],1)<>['a';'x']) then bugmes();quit;end
 
33
 
 
34
if or(part(['abc';'x'],[1 1])<>['aa';'xx']) then bugmes();quit;end
 
35
 
 
36
//if or(part(['abc';'x'],[1 2])<>['aa';'x ']) then bugmes();quit;end
 
37
 
 
38
 
 
39
//string
 
40
 
 
41
if string(1)<>'1' then bugmes();quit;end
 
42
 
 
43
if string(1.5)<>'1.5' then bugmes();quit;end
 
44
 
 
45
if string([])<>[] then bugmes();quit;end
 
46
 
 
47
if or(string(1:3)<>['1','2','3']) then bugmes();quit;end
 
48
 
 
49
if or(string([1;2;3])<>['1';'2';'3']) then bugmes();quit;end
 
50
 
 
51
if string('foo')<>'foo' then bugmes();quit;end
 
52
 
 
53
deff('y=mymacro(x)','y=x+1');
 
54
 
 
55
[out,in,text]=string(mymacro);
 
56
 
 
57
if out<>'y'|in<>'x'|text<>[] then bugmes();quit;end
 
58
 
 
59
mymacro=null();deff('y=mymacro(x)','y=x+1','n');
 
60
 
 
61
[out,in,text]=string(mymacro);
 
62
 
 
63
if out<>'y'|in<>'x'|text<>'y=x+1' then bugmes();quit;end
 
64
 
 
65
 
 
66
 
 
67
//convstr
 
68
 
 
69
if convstr('ABC')<>'abc' then bugmes();quit;end
 
70
 
 
71
if convstr('ABC','l')<>'abc' then bugmes();quit;end
 
72
 
 
73
if convstr('ABC','u')<>'ABC' then bugmes();quit;end
 
74
 
 
75
if convstr(['ABC';'x'])<>['abc';'x'] then bugmes();quit;end
 
76
 
 
77
if convstr(['ABC';'x'],'l')<>['abc';'x'] then bugmes();quit;end
 
78
 
 
79
if convstr(['ABC';'x'],'u')<>['ABC';'X'] then bugmes();quit;end
 
80
 
 
81
 
 
82
if convstr('ABC')<>'abc' then bugmes();quit;end
 
83
 
 
84
if convstr('ABC','l')<>'abc' then bugmes();quit;end
 
85
 
 
86
if convstr('ABC','u')<>'ABC' then bugmes();quit;end
 
87
 
 
88
if convstr(['ABC','x'])<>['abc','x'] then bugmes();quit;end
 
89
 
 
90
if convstr(['ABC','x'],'l')<>['abc','x'] then bugmes();quit;end
 
91
 
 
92
if convstr(['ABC','x'],'u')<>['ABC','X'] then bugmes();quit;end
 
93
 
 
94
if convstr(emptystr())<>emptystr() then bugmes();quit;end
 
95
 
 
96
 
 
97
//str2code
 
98
 
 
99
if or(str2code('abcdefghijklmnopqrstuvwxyz')<>(10:35)') then bugmes();quit;end
 
100
 
 
101
if or(str2code('ABCDEFGHIJKLMNOPQRSTUVWXYZ')<>-(10:35)') then bugmes();quit;end
 
102
 
 
103
if or(str2code('0123456789')<>(0:9)') then bugmes();quit;end
 
104
 
 
105
if str2code(emptystr())<>[] then bugmes();quit;end
 
106
 
 
107
 
 
108
 
 
109
//code2str
 
110
 
 
111
 
 
112
if code2str(10:35)<>'abcdefghijklmnopqrstuvwxyz' then bugmes();quit;end
 
113
 
 
114
if code2str(-(10:35))<>'ABCDEFGHIJKLMNOPQRSTUVWXYZ' then bugmes();quit;end
 
115
 
 
116
if code2str(0:9)<>'0123456789' then bugmes();quit;end
 
117
 
 
118
if code2str([])<>emptystr() then bugmes();quit;end
 
119
 
 
120
 
 
121
 
 
122
//sort
 
123
 
 
124
[s]=sort(['abc','abd','aa','bxe']);
 
125
 
 
126
if or(s<>['aa','abc','abd','bxe']) then bugmes();quit;end
 
127
 
 
128
 
 
129
[s,k]=sort(['abc','abd','aa','bxe']);
 
130
 
 
131
if or(s<>['aa','abc','abd','bxe']) then bugmes();quit;end
 
132
 
 
133
if or(k<>[3 1 2 4])  then bugmes();quit;end
 
134
 
 
135
 
 
136
if sort('abc')<>'abc' then bugmes();quit;end
 
137
 
 
138
 
 
139
//strcat
 
140
 
 
141
 
 
142
if strcat(['abc','abd','aa','bxe'])<>'abcabdaabxe' then bugmes();quit;end
 
143
 
 
144
if strcat(['abc','abd','aa','bxe'],',')<>'abc,abd,aa,bxe' then bugmes();quit;end
 
145
 
 
146
if strcat('abc')<>'abc' then bugmes();quit;end
 
147
 
 
148
if strcat('abc','sd')<>'abc' then bugmes();quit;end
 
149
 
 
150
 
 
151
//strindex
 
152
 
 
153
if or(strindex('abc,abd,aa,bxe',',')<>[4 8 11]) then bugmes();quit;end
 
154
 
 
155
if or(strindex('abc',',')<>[]) then bugmes();quit;end
 
156
 
 
157
if or(strindex('abc,abd,aa,bxe',',a')<>[4 8]) then bugmes();quit;end
 
158
 
 
159
if or(strindex('abc,abd,aa,bxe','a')<>[1 5 9 10]) then bugmes();quit;end
 
160
 
 
161
//if or(strindex(emptystr(),'a'))<>[] then bugmes();quit;end
 
162
 
 
163
 
 
164
//strsubst
 
165
 
 
166
if strsubst('abc,abd,aa,bxe',',',';')<>'abc;abd;aa;bxe'  then bugmes();quit;end
 
167
 
 
168
if strsubst('abc,abd,aa,bxe',',',emptystr())<>'abcabdaabxe'  then bugmes();quit;end
 
169
 
 
170
if strsubst(',abc,abd,aa,bxe',',',emptystr())<>'abcabdaabxe'  then bugmes();quit;end
 
171
 
 
172
if strsubst('abc',',',';')<>'abc'  then bugmes();quit;end
 
173
 
 
174
 
 
175
//formal
 
176
 
 
177
if addf('1','1')<>'2' then bugmes();quit;end
 
178
 
 
179
if addf('1','0')<>'1' then bugmes();quit;end
 
180
 
 
181
if addf('0','1')<>'1' then bugmes();quit;end
 
182
 
 
183
if addf('0','0')<>'0' then bugmes();quit;end
 
184
 
 
185
if addf('1','-1')<>'0' then bugmes();quit;end
 
186
 
 
187
if addf('-1','1')<>'0' then bugmes();quit;end
 
188
 
 
189
if addf('-1','0')<>'-1' then bugmes();quit;end
 
190
 
 
191
if addf('0','-1')<>'-1' then bugmes();quit;end
 
192
 
 
193
 
 
194
if addf('1','a')<>'a+1' then bugmes();quit;end
 
195
 
 
196
if addf('a','1')<>'a+1' then bugmes();quit;end
 
197
 
 
198
if addf('a','0')<>'a' then bugmes();quit;end
 
199
 
 
200
if addf('0','a')<>'a' then bugmes();quit;end
 
201
 
 
202
if addf('a','-1')<>'a-1' then bugmes();quit;end
 
203
 
 
204
if addf('-1','a')<>'a-1' then bugmes();quit;end
 
205
 
 
206
if addf('a','b')<>'a+b' then bugmes();quit;end
 
207
 
 
208
if addf('a+b','c')<>'a+b+c' then bugmes();quit;end
 
209
 
 
210
if addf('c','a+b')<>'c+a+b' then bugmes();quit;end
 
211
 
 
212
if addf('a+b','a+b')<>'a+b+a+b' then bugmes();quit;end
 
213
 
 
214
if addf('a+b','a-b')<>'a+a' then bugmes();quit;end
 
215
 
 
216
if addf('2*a+b','a-b')<>'2*a+a' then bugmes();quit;end
 
217
 
 
218
 
 
219
if mulf('1','1')<>'1' then bugmes();quit;end
 
220
 
 
221
if mulf('1','0')<>'0' then bugmes();quit;end
 
222
 
 
223
if mulf('0','1')<>'0' then bugmes();quit;end
 
224
 
 
225
if mulf('0','0')<>'0' then bugmes();quit;end
 
226
 
 
227
if mulf('1','-1')<>'-1' then bugmes();quit;end
 
228
 
 
229
if mulf('-1','1')<>'-1' then bugmes();quit;end
 
230
 
 
231
if mulf('-1','0')<>'0' then bugmes();quit;end
 
232
 
 
233
if mulf('0','-1')<>'0' then bugmes();quit;end
 
234
 
 
235
 
 
236
if mulf('1','a')<>'a' then bugmes();quit;end
 
237
 
 
238
if mulf('a','1')<>'a' then bugmes();quit;end
 
239
 
 
240
if mulf('a','0')<>'0' then bugmes();quit;end
 
241
 
 
242
if mulf('0','a')<>'0' then bugmes();quit;end
 
243
 
 
244
if mulf('a','-1')<>'-a' then bugmes();quit;end
 
245
 
 
246
if mulf('-1','a')<>'-a' then bugmes();quit;end
 
247
 
 
248
if mulf('a','b')<>'a*b' then bugmes();quit;end
 
249
 
 
250
if mulf('a+b','c')<>'(a+b)*c' then bugmes();quit;end
 
251
 
 
252
if mulf('c','a+b')<>'c*(a+b)' then bugmes();quit;end
 
253
 
 
254
if mulf('a+b','a+b')<>'(a+b)*(a+b)' then bugmes();quit;end
 
255
 
 
256
if mulf('2*a+b','a-b')<>'(2*a+b)*(a-b)' then bugmes();quit;end
 
257
 
 
258