fix codetest failure - ASSERT_ARGS does not have a ; after and
[parrot.git] / t / op / cmp-nonbranch.t
blob584695327b7ff9f61a3b2a240b970507918d82bb
1 #!./parrot
2 # Copyright (C) 2006-2008, Parrot Foundation.
3 # $Id$
5 =head1 NAME
7 t/op/cmp-nonbranch.t - Non-branching conditionals
9 =head1 SYNOPSIS
11         % prove t/op/cmp-nonbranch.t
13 =head1 DESCRIPTION
15 Tests all non-branching conditional operators.
17 =cut
20 .const int TESTS = 96
22 .macro EXP()
23   exp_nok:
24     exp = 0
25     local_return jmpstack
26   exp_ok:
27     exp = 1
28     local_return jmpstack
29 .endm
31 .macro TEST()
32     is( res, exp, desc )
33     local_return jmpstack
34 .endm
36 .macro SET_DESC(op)
37     .local string desc
38     desc = .op
39 .endm
41 .macro RESET_DESC(op)
42     desc = .op
43 .endm
45 .macro CONCAT_RES()
46     $S98 = $I1
47     concat res, $S98
48 .endm
51 .sub 'main' :main
52     .include 'test_more.pir'
54     'plan'(TESTS)
56     'issame'()
57     'isntsame'()
58     'istrue'()
59     'isfalse'()
60     'isnull_pmc'()
61     'isnull_string'()
62     'isgt'()
63     'isge'()
64     'isle'()
65     'islt'()
66     'iseq'()
67     'isne'()
68     'cmp'()
69     'cmp_string_null'()
70     'trac#11'()
71 .end
74 .sub 'issame'
75     .local int exp, res
76     .local pmc jmpstack
77                jmpstack = new 'ResizableIntegerArray'
78     .SET_DESC('issame')
80   init:
81     $P0 = new 'Integer'
82     $P1 = new 'String'
83     local_branch jmpstack,  exp_nok
84     local_branch jmpstack,  test_it   # not ok
85     $P0 = new 'String'
86     local_branch jmpstack,  test_it   # not ok
87     local_branch jmpstack,  exp_ok
88     $P1 = $P0
89     local_branch jmpstack,  test_it   # ok
90     $P0 = new 'Null'
91     $P1 = new 'Null'
92     local_branch jmpstack,  test_it   # ok -- Null is a singleton
93     .return()
95     .EXP()
96   test_it:
97     res = issame $P0, $P1
98     .TEST()
99 .end
102 .sub 'isntsame'
103     .local int exp, res
104     .local pmc jmpstack
105                jmpstack = new 'ResizableIntegerArray'
106     .SET_DESC('isntsame')
108   init:
109     $P0 = new 'Integer'
110     $P1 = new 'String'
111     local_branch jmpstack,  exp_ok
112     local_branch jmpstack,  test_it   # ok
113     $P0 = new 'String'
114     local_branch jmpstack,  test_it   # ok
115     $P1 = $P0
116     local_branch jmpstack,  exp_nok
117     local_branch jmpstack,  test_it   # not ok
118     $P0 = new 'Null'
119     $P1 = new 'Null'
120     local_branch jmpstack,  test_it   # not ok -- Null is a singleton
121     .return()
123     .EXP()
124   test_it:
125     res = isntsame $P0, $P1
126     .TEST()
127 .end
130 .sub 'istrue'
131     .local int exp, res
132     .local pmc jmpstack
133                jmpstack = new 'ResizableIntegerArray'
134     .SET_DESC('istrue')
136   init:
137     $P0 = new 'Integer'
138     $P0 = 0
139     local_branch jmpstack,  exp_nok
140     local_branch jmpstack,  test_it   # not ok
141     $P0 = 1
142     local_branch jmpstack,  exp_ok
143     local_branch jmpstack,  test_it   # ok
144     .return()
146     .EXP()
147   test_it:
148     res = istrue $P0
149     .TEST()
150 .end
153 .sub 'isfalse'
154     .local int exp, res
155     .local pmc jmpstack
156                jmpstack = new 'ResizableIntegerArray'
157     .SET_DESC('isfalse')
159   init:
160     $P0 = new 'Integer'
161     $P0 = 0
162     local_branch jmpstack,  exp_ok
163     local_branch jmpstack,  test_it   # ok
164     $P0 = 1
165     local_branch jmpstack,  exp_nok
166     local_branch jmpstack,  test_it   # not ok
167     .return()
169     .EXP()
170   test_it:
171     res = isfalse $P0
172     .TEST()
173 .end
176 .sub 'isnull_pmc'
177     .local int exp, res
178     .local pmc jmpstack
179                jmpstack = new 'ResizableIntegerArray'
180     .SET_DESC('isnull pmc')
182   init:
183     $S0 = 'FUBAR'
184     local_branch jmpstack,  exp_ok
185     local_branch jmpstack,  test_it
186     $S0 = 'Null' # this is a valid pmc type -- you can't trick parrot :)
187     local_branch jmpstack,  exp_nok
188     local_branch jmpstack,  test_it
189     $S0 = 'Integer'
190     local_branch jmpstack,  test_it
191     .return()
193     .EXP()
194   test_it:
195     res = 0
196     push_eh fubar
197     $P0 = new $S0
198     pop_eh
199     goto test
201   fubar:
202     res = isnull $P0
203   test:
204     .TEST()
205 .end
208 .sub 'isnull_string'
209     .local int res
210     null $S0
211     res = isnull $S0
212     is(res, 1, 'isnull string null')
213     $S0 = 'something'
214     res = isnull $S0
215     is(res, 0, 'isnull string non null')
216     res = isnull 'H'
217     is(res, 0, 'isnull string constant')
218 .end
220 .sub 'isgt'
221     .local string exp, res
223     exp = '001'
225     .SET_DESC('isgt_i_i_i')
226     set $I1, 111
227     set $I2, 222
228     set $I3, 333
229     isgt $I1, $I2, $I3
230     .CONCAT_RES()
231     set $I2, $I3
232     isgt $I1, $I2, $I3
233     .CONCAT_RES()
234     inc $I2
235     isgt $I1, $I2, $I3
236     .CONCAT_RES()
237     is( res, exp, desc)
239     res = ''
240     .RESET_DESC('isgt_i_ic_i')
241     set $I1, 111
242     set $I3, 333
243     isgt $I1, 222, $I3
244     .CONCAT_RES()
245     isgt $I1, 333, $I3
246     .CONCAT_RES()
247     isgt $I1, 334, $I3
248     .CONCAT_RES()
249     is( res, exp, desc)
251     res = ''
252     .RESET_DESC('isgt_i_i_ic')
253     set $I1, 111
254     set $I2, 222
255     isgt $I1, $I2, 223
256     .CONCAT_RES()
257     isgt $I1, $I2, 222
258     .CONCAT_RES()
259     isgt $I1, $I2, 221
260     .CONCAT_RES()
261     is( res, exp, desc)
263     res = ''
264     .RESET_DESC('isgt_i_ic_ic')
265     set $I1, 111
266     isgt $I1, 222, 223
267     .CONCAT_RES()
268     isgt $I1, 222, 222
269     .CONCAT_RES()
270     isgt $I1, 222, 221
271     .CONCAT_RES()
272     is( res, exp, desc)
274     res = ''
275     .RESET_DESC('isgt_i_n_n')
276     set $I1, 111
277     set $N2, 2.22
278     set $N3, 3.33
279     isgt $I1, $N2, $N3
280     .CONCAT_RES()
281     set $N2, $N3
282     isgt $I1, $N2, $N3
283     .CONCAT_RES()
284     inc $N2
285     isgt $I1, $N2, $N3
286     .CONCAT_RES()
287     is( res, exp, desc)
289     res = ''
290     .RESET_DESC('isgt_i_nc_n')
291     set $I1, 111
292     set $N3, 3.33
293     isgt $I1, 2.22, $N3
294     .CONCAT_RES()
295     isgt $I1, 3.33, $N3
296     .CONCAT_RES()
297     isgt $I1, 3.34, $N3
298     .CONCAT_RES()
299     is( res, exp, desc)
301     res = ''
302     .RESET_DESC('isgt_i_n_nc')
303     set $I1, 111
304     set $N2, 2.22
305     isgt $I1, $N2, 2.23
306     .CONCAT_RES()
307     isgt $I1, $N2, 2.22
308     .CONCAT_RES()
309     isgt $I1, $N2, 2.21
310     .CONCAT_RES()
311     is( res, exp, desc)
313     res = ''
314     .RESET_DESC('isgt_i_nc_nc')
315     set $I1, 111
316     isgt $I1, 2.22, 2.23
317     .CONCAT_RES()
318     isgt $I1, 2.22, 2.22
319     .CONCAT_RES()
320     isgt $I1, 2.22, 2.21
321     .CONCAT_RES()
322     is( res, exp, desc)
324     res = ''
325     .RESET_DESC('isgt_i_s_s')
326     set $I1, 111
327     set $S2, "Aaa"
328     set $S3, "Bbb"
329     isgt $I1, $S2, $S3
330     .CONCAT_RES()
331     set $S2, $S3
332     isgt $I1, $S2, $S3
333     .CONCAT_RES()
334     set $S2, "Ccc"
335     isgt $I1, $S2, $S3
336     .CONCAT_RES()
337     is( res, exp, desc)
339     res = ''
340     .RESET_DESC('isgt_i_sc_s')
341     set $I1, 111
342     set $S3, "Bbb"
343     isgt $I1, "Aaa", $S3
344     .CONCAT_RES()
345     isgt $I1, "Bbb", $S3
346     .CONCAT_RES()
347     isgt $I1, "Ccc", $S3
348     .CONCAT_RES()
349     is( res, exp, desc)
351     res = ''
352     .RESET_DESC('isgt_i_s_sc')
353     set $I1, 111
354     set $S2, "Bbb"
355     isgt $I1, $S2, "Ccc"
356     .CONCAT_RES()
357     isgt $I1, $S2, "Bbb"
358     .CONCAT_RES()
359     isgt $I1, $S2, "Aaa"
360     .CONCAT_RES()
361     is( res, exp, desc)
363     res = ''
364     .RESET_DESC('isgt_i_sc_sc')
365     set $I1, 111
366     isgt $I1, "Bbb", "Ccc"
367     .CONCAT_RES()
368     isgt $I1, "Bbb", "Bbb"
369     .CONCAT_RES()
370     isgt $I1, "Bbb", "Aaa"
371     .CONCAT_RES()
372     is( res, exp, desc)
373 .end
376 .sub 'isge'
377     .local string exp, res
379     exp = '011'
381     .SET_DESC('isge_i_i_i')
382     set $I1, 111
383     set $I2, 222
384     set $I3, 333
385     isge $I1, $I2, $I3
386     .CONCAT_RES()
387     set $I2, $I3
388     isge $I1, $I2, $I3
389     .CONCAT_RES()
390     inc $I2
391     isge $I1, $I2, $I3
392     .CONCAT_RES()
393     is( res, exp, desc)
395     res = ''
396     .RESET_DESC('isge_i_ic_i')
397     set $I1, 111
398     set $I3, 333
399     isge $I1, 222, $I3
400     .CONCAT_RES()
401     isge $I1, 333, $I3
402     .CONCAT_RES()
403     isge $I1, 334, $I3
404     .CONCAT_RES()
405     is( res, exp, desc)
407     res = ''
408     .RESET_DESC('isge_i_i_ic')
409     set $I1, 111
410     set $I2, 222
411     isge $I1, $I2, 223
412     .CONCAT_RES()
413     isge $I1, $I2, 222
414     .CONCAT_RES()
415     isge $I1, $I2, 221
416     .CONCAT_RES()
417     is( res, exp, desc)
419     res = ''
420     .RESET_DESC('isge_i_ic_ic')
421     set $I1, 111
422     isge $I1, 222, 223
423     .CONCAT_RES()
424     isge $I1, 222, 222
425     .CONCAT_RES()
426     isge $I1, 222, 221
427     .CONCAT_RES()
428     is( res, exp, desc)
430     res = ''
431     .RESET_DESC('isge_i_n_n')
432     set $I1, 111
433     set $N2, 2.22
434     set $N3, 3.33
435     isge $I1, $N2, $N3
436     .CONCAT_RES()
437     set $N2, $N3
438     isge $I1, $N2, $N3
439     .CONCAT_RES()
440     inc $N2
441     isge $I1, $N2, $N3
442     .CONCAT_RES()
443     is( res, exp, desc)
445     res = ''
446     .RESET_DESC('isge_i_nc_n')
447     set $I1, 111
448     set $N3, 3.33
449     isge $I1, 2.22, $N3
450     .CONCAT_RES()
451     isge $I1, 3.33, $N3
452     .CONCAT_RES()
453     isge $I1, 3.34, $N3
454     .CONCAT_RES()
455     is( res, exp, desc)
457     res = ''
458     .RESET_DESC('isge_i_n_nc')
459     set $I1, 111
460     set $N2, 2.22
461     isge $I1, $N2, 2.23
462     .CONCAT_RES()
463     isge $I1, $N2, 2.22
464     .CONCAT_RES()
465     isge $I1, $N2, 2.21
466     .CONCAT_RES()
467     is( res, exp, desc)
469     res = ''
470     .RESET_DESC('isge_i_nc_nc')
471     set $I1, 111
472     isge $I1, 2.22, 2.23
473     .CONCAT_RES()
474     isge $I1, 2.22, 2.22
475     .CONCAT_RES()
476     isge $I1, 2.22, 2.21
477     .CONCAT_RES()
478     is( res, exp, desc)
480     res = ''
481     .RESET_DESC('isge_i_s_s')
482     set $I1, 111
483     set $S2, "Aaa"
484     set $S3, "Bbb"
485     isge $I1, $S2, $S3
486     .CONCAT_RES()
487     set $S2, $S3
488     isge $I1, $S2, $S3
489     .CONCAT_RES()
490     set $S2, "Ccc"
491     isge $I1, $S2, $S3
492     .CONCAT_RES()
493     is( res, exp, desc)
495     res = ''
496     .RESET_DESC('isge_i_sc_s')
497     set $I1, 111
498     set $S3, "Bbb"
499     isge $I1, "Aaa", $S3
500     .CONCAT_RES()
501     isge $I1, "Bbb", $S3
502     .CONCAT_RES()
503     isge $I1, "Ccc", $S3
504     .CONCAT_RES()
505     is( res, exp, desc)
507     res = ''
508     .RESET_DESC('isge_i_s_sc')
509     set $I1, 111
510     set $S2, "Bbb"
511     isge $I1, $S2, "Ccc"
512     .CONCAT_RES()
513     isge $I1, $S2, "Bbb"
514     .CONCAT_RES()
515     isge $I1, $S2, "Aaa"
516     .CONCAT_RES()
517     is( res, exp, desc)
519     res = ''
520     .RESET_DESC('isge_i_sc_sc')
521     set $I1, 111
522     isge $I1, "Bbb", "Ccc"
523     .CONCAT_RES()
524     isge $I1, "Bbb", "Bbb"
525     .CONCAT_RES()
526     isge $I1, "Bbb", "Aaa"
527     .CONCAT_RES()
528     is( res, exp, desc)
529 .end
532 .sub 'isle'
533     .local string exp, res
535     exp = '110'
537     .SET_DESC('isle_i_i_i')
538     set $I1, 111
539     set $I2, 222
540     set $I3, 333
541     isle $I1, $I2, $I3
542     .CONCAT_RES()
543     set $I2, $I3
544     isle $I1, $I2, $I3
545     .CONCAT_RES()
546     inc $I2
547     isle $I1, $I2, $I3
548     .CONCAT_RES()
549     is( res, exp, desc)
551     res = ''
552     .RESET_DESC('isle_i_ic_i')
553     set $I1, 111
554     set $I3, 333
555     isle $I1, 222, $I3
556     .CONCAT_RES()
557     isle $I1, 333, $I3
558     .CONCAT_RES()
559     isle $I1, 334, $I3
560     .CONCAT_RES()
561     is( res, exp, desc)
563     res = ''
564     .RESET_DESC('isle_i_i_ic')
565     set $I1, 111
566     set $I2, 222
567     isle $I1, $I2, 223
568     .CONCAT_RES()
569     isle $I1, $I2, 222
570     .CONCAT_RES()
571     isle $I1, $I2, 221
572     .CONCAT_RES()
573     is( res, exp, desc)
575     res = ''
576     .RESET_DESC('isle_i_ic_ic')
577     set $I1, 111
578     isle $I1, 222, 223
579     .CONCAT_RES()
580     isle $I1, 222, 222
581     .CONCAT_RES()
582     isle $I1, 222, 221
583     .CONCAT_RES()
584     is( res, exp, desc)
586     res = ''
587     .RESET_DESC('isle_i_n_n')
588     set $I1, 111
589     set $N2, 2.22
590     set $N3, 3.33
591     isle $I1, $N2, $N3
592     .CONCAT_RES()
593     set $N2, $N3
594     isle $I1, $N2, $N3
595     .CONCAT_RES()
596     inc $N2
597     isle $I1, $N2, $N3
598     .CONCAT_RES()
599     is( res, exp, desc)
601     res = ''
602     .RESET_DESC('isle_i_nc_n')
603     set $I1, 111
604     set $N3, 3.33
605     isle $I1, 2.22, $N3
606     .CONCAT_RES()
607     isle $I1, 3.33, $N3
608     .CONCAT_RES()
609     isle $I1, 3.34, $N3
610     .CONCAT_RES()
611     is( res, exp, desc)
613     res = ''
614     .RESET_DESC('isle_i_n_nc')
615     set $I1, 111
616     set $N2, 2.22
617     isle $I1, $N2, 2.23
618     .CONCAT_RES()
619     isle $I1, $N2, 2.22
620     .CONCAT_RES()
621     isle $I1, $N2, 2.21
622     .CONCAT_RES()
623     is( res, exp, desc)
625     res = ''
626     .RESET_DESC('isle_i_nc_nc')
627     set $I1, 111
628     isle $I1, 2.22, 2.23
629     .CONCAT_RES()
630     isle $I1, 2.22, 2.22
631     .CONCAT_RES()
632     isle $I1, 2.22, 2.21
633     .CONCAT_RES()
634     is( res, exp, desc)
636     res = ''
637     .RESET_DESC('isle_i_s_s')
638     set $I1, 111
639     set $S2, "Aaa"
640     set $S3, "Bbb"
641     isle $I1, $S2, $S3
642     .CONCAT_RES()
643     set $S2, $S3
644     isle $I1, $S2, $S3
645     .CONCAT_RES()
646     set $S2, "Ccc"
647     isle $I1, $S2, $S3
648     .CONCAT_RES()
649     is( res, exp, desc)
651     res = ''
652     .RESET_DESC('isle_i_sc_s')
653     set $I1, 111
654     set $S3, "Bbb"
655     isle $I1, "Aaa", $S3
656     .CONCAT_RES()
657     isle $I1, "Bbb", $S3
658     .CONCAT_RES()
659     isle $I1, "Ccc", $S3
660     .CONCAT_RES()
661     is( res, exp, desc)
663     res = ''
664     .RESET_DESC('isle_i_s_sc')
665     set $I1, 111
666     set $S2, "Bbb"
667     isle $I1, $S2, "Ccc"
668     .CONCAT_RES()
669     isle $I1, $S2, "Bbb"
670     .CONCAT_RES()
671     isle $I1, $S2, "Aaa"
672     .CONCAT_RES()
673     is( res, exp, desc)
675     res = ''
676     .RESET_DESC('isle_i_sc_sc')
677     set $I1, 111
678     isle $I1, "Bbb", "Ccc"
679     .CONCAT_RES()
680     isle $I1, "Bbb", "Bbb"
681     .CONCAT_RES()
682     isle $I1, "Bbb", "Aaa"
683     .CONCAT_RES()
684     is( res, exp, desc)
685 .end
688 .sub 'islt'
689     .local string exp, res
691     exp = '100'
693     .SET_DESC('islt_i_i_i')
694     set $I1, 111
695     set $I2, 222
696     set $I3, 333
697     islt $I1, $I2, $I3
698     .CONCAT_RES()
699     set $I2, $I3
700     islt $I1, $I2, $I3
701     .CONCAT_RES()
702     inc $I2
703     islt $I1, $I2, $I3
704     .CONCAT_RES()
705     is( res, exp, desc)
707     res = ''
708     .RESET_DESC('islt_i_ic_i')
709     set $I1, 111
710     set $I3, 333
711     islt $I1, 222, $I3
712     .CONCAT_RES()
713     islt $I1, 333, $I3
714     .CONCAT_RES()
715     islt $I1, 334, $I3
716     .CONCAT_RES()
717     is( res, exp, desc)
719     res = ''
720     .RESET_DESC('islt_i_i_ic')
721     set $I1, 111
722     set $I2, 222
723     islt $I1, $I2, 223
724     .CONCAT_RES()
725     islt $I1, $I2, 222
726     .CONCAT_RES()
727     islt $I1, $I2, 221
728     .CONCAT_RES()
729     is( res, exp, desc)
731     res = ''
732     .RESET_DESC('islt_i_ic_ic')
733     set $I1, 111
734     islt $I1, 222, 223
735     .CONCAT_RES()
736     islt $I1, 222, 222
737     .CONCAT_RES()
738     islt $I1, 222, 221
739     .CONCAT_RES()
740     is( res, exp, desc)
742     res = ''
743     .RESET_DESC('islt_i_n_n')
744     set $I1, 111
745     set $N2, 2.22
746     set $N3, 3.33
747     islt $I1, $N2, $N3
748     .CONCAT_RES()
749     set $N2, $N3
750     islt $I1, $N2, $N3
751     .CONCAT_RES()
752     inc $N2
753     islt $I1, $N2, $N3
754     .CONCAT_RES()
755     is( res, exp, desc)
757     res = ''
758     .RESET_DESC('islt_i_nc_n')
759     set $I1, 111
760     set $N3, 3.33
761     islt $I1, 2.22, $N3
762     .CONCAT_RES()
763     islt $I1, 3.33, $N3
764     .CONCAT_RES()
765     islt $I1, 3.34, $N3
766     .CONCAT_RES()
767     is( res, exp, desc)
769     res = ''
770     .RESET_DESC('islt_i_n_nc')
771     set $I1, 111
772     set $N2, 2.22
773     islt $I1, $N2, 2.23
774     .CONCAT_RES()
775     islt $I1, $N2, 2.22
776     .CONCAT_RES()
777     islt $I1, $N2, 2.21
778     .CONCAT_RES()
779     is( res, exp, desc)
781     res = ''
782     .RESET_DESC('islt_i_nc_nc')
783     set $I1, 111
784     islt $I1, 2.22, 2.23
785     .CONCAT_RES()
786     islt $I1, 2.22, 2.22
787     .CONCAT_RES()
788     islt $I1, 2.22, 2.21
789     .CONCAT_RES()
790     is( res, exp, desc)
792     res = ''
793     .RESET_DESC('islt_i_s_s')
794     set $I1, 111
795     set $S2, "Aaa"
796     set $S3, "Bbb"
797     islt $I1, $S2, $S3
798     .CONCAT_RES()
799     set $S2, $S3
800     islt $I1, $S2, $S3
801     .CONCAT_RES()
802     set $S2, "Ccc"
803     islt $I1, $S2, $S3
804     .CONCAT_RES()
805     is( res, exp, desc)
807     res = ''
808     .RESET_DESC('islt_i_sc_s')
809     set $I1, 111
810     set $S3, "Bbb"
811     islt $I1, "Aaa", $S3
812     .CONCAT_RES()
813     islt $I1, "Bbb", $S3
814     .CONCAT_RES()
815     islt $I1, "Ccc", $S3
816     .CONCAT_RES()
817     is( res, exp, desc)
819     res = ''
820     .RESET_DESC('islt_i_s_sc')
821     set $I1, 111
822     set $S2, "Bbb"
823     islt $I1, $S2, "Ccc"
824     .CONCAT_RES()
825     islt $I1, $S2, "Bbb"
826     .CONCAT_RES()
827     islt $I1, $S2, "Aaa"
828     .CONCAT_RES()
829     is( res, exp, desc)
831     res = ''
832     .RESET_DESC('islt_i_sc_sc')
833     set $I1, 111
834     islt $I1, "Bbb", "Ccc"
835     .CONCAT_RES()
836     islt $I1, "Bbb", "Bbb"
837     .CONCAT_RES()
838     islt $I1, "Bbb", "Aaa"
839     .CONCAT_RES()
840     is( res, exp, desc)
841 .end
844 .sub 'iseq'
845     .local string exp, res
847     exp = '010'
849     .SET_DESC('iseq_i_i_i')
850     set $I1, 111
851     set $I2, 222
852     set $I3, 333
853     iseq $I1, $I2, $I3
854     .CONCAT_RES()
855     set $I2, $I3
856     iseq $I1, $I2, $I3
857     .CONCAT_RES()
858     inc $I2
859     iseq $I1, $I2, $I3
860     .CONCAT_RES()
861     is( res, exp, desc)
863     res = ''
864     .RESET_DESC('iseq_i_ic_i')
865     set $I1, 111
866     set $I3, 333
867     iseq $I1, 222, $I3
868     .CONCAT_RES()
869     iseq $I1, 333, $I3
870     .CONCAT_RES()
871     iseq $I1, 334, $I3
872     .CONCAT_RES()
873     is( res, exp, desc)
875     res = ''
876     .RESET_DESC('iseq_i_i_ic')
877     set $I1, 111
878     set $I2, 222
879     iseq $I1, $I2, 223
880     .CONCAT_RES()
881     iseq $I1, $I2, 222
882     .CONCAT_RES()
883     iseq $I1, $I2, 221
884     .CONCAT_RES()
885     is( res, exp, desc)
887     res = ''
888     .RESET_DESC('iseq_i_ic_ic')
889     set $I1, 111
890     iseq $I1, 222, 223
891     .CONCAT_RES()
892     iseq $I1, 222, 222
893     .CONCAT_RES()
894     iseq $I1, 222, 221
895     .CONCAT_RES()
896     is( res, exp, desc)
898     res = ''
899     .RESET_DESC('iseq_i_n_n')
900     set $I1, 111
901     set $N2, 2.22
902     set $N3, 3.33
903     iseq $I1, $N2, $N3
904     .CONCAT_RES()
905     set $N2, $N3
906     iseq $I1, $N2, $N3
907     .CONCAT_RES()
908     inc $N2
909     iseq $I1, $N2, $N3
910     .CONCAT_RES()
911     is( res, exp, desc)
913     res = ''
914     .RESET_DESC('iseq_i_nc_n')
915     set $I1, 111
916     set $N3, 3.33
917     iseq $I1, 2.22, $N3
918     .CONCAT_RES()
919     iseq $I1, 3.33, $N3
920     .CONCAT_RES()
921     iseq $I1, 3.34, $N3
922     .CONCAT_RES()
923     is( res, exp, desc)
925     res = ''
926     .RESET_DESC('iseq_i_n_nc')
927     set $I1, 111
928     set $N2, 2.22
929     iseq $I1, $N2, 2.23
930     .CONCAT_RES()
931     iseq $I1, $N2, 2.22
932     .CONCAT_RES()
933     iseq $I1, $N2, 2.21
934     .CONCAT_RES()
935     is( res, exp, desc)
937     res = ''
938     .RESET_DESC('iseq_i_nc_nc')
939     set $I1, 111
940     iseq $I1, 2.22, 2.23
941     .CONCAT_RES()
942     iseq $I1, 2.22, 2.22
943     .CONCAT_RES()
944     iseq $I1, 2.22, 2.21
945     .CONCAT_RES()
946     is( res, exp, desc)
948     res = ''
949     .RESET_DESC('iseq_i_s_s')
950     set $I1, 111
951     set $S2, "Aaa"
952     set $S3, "Bbb"
953     iseq $I1, $S2, $S3
954     .CONCAT_RES()
955     set $S2, $S3
956     iseq $I1, $S2, $S3
957     .CONCAT_RES()
958     set $S2, "Ccc"
959     iseq $I1, $S2, $S3
960     .CONCAT_RES()
961     is( res, exp, desc)
963     res = ''
964     .RESET_DESC('iseq_i_sc_s')
965     set $I1, 111
966     set $S3, "Bbb"
967     iseq $I1, "Aaa", $S3
968     .CONCAT_RES()
969     iseq $I1, "Bbb", $S3
970     .CONCAT_RES()
971     iseq $I1, "Ccc", $S3
972     .CONCAT_RES()
973     is( res, exp, desc)
975     res = ''
976     .RESET_DESC('iseq_i_s_sc')
977     set $I1, 111
978     set $S2, "Bbb"
979     iseq $I1, $S2, "Ccc"
980     .CONCAT_RES()
981     iseq $I1, $S2, "Bbb"
982     .CONCAT_RES()
983     iseq $I1, $S2, "Aaa"
984     .CONCAT_RES()
985     is( res, exp, desc)
987     res = ''
988     .RESET_DESC('iseq_i_sc_sc')
989     set $I1, 111
990     iseq $I1, "Bbb", "Ccc"
991     .CONCAT_RES()
992     iseq $I1, "Bbb", "Bbb"
993     .CONCAT_RES()
994     iseq $I1, "Bbb", "Aaa"
995     .CONCAT_RES()
996     is( res, exp, desc)
997 .end
1000 .sub 'isne'
1001     .local string exp, res
1003     exp = '101'
1005     .SET_DESC('isne_i_i_i')
1006     set $I1, 111
1007     set $I2, 222
1008     set $I3, 333
1009     isne $I1, $I2, $I3
1010     .CONCAT_RES()
1011     set $I2, $I3
1012     isne $I1, $I2, $I3
1013     .CONCAT_RES()
1014     inc $I2
1015     isne $I1, $I2, $I3
1016     .CONCAT_RES()
1017     is( res, exp, desc)
1019     res = ''
1020     .RESET_DESC('isne_i_ic_i')
1021     set $I1, 111
1022     set $I3, 333
1023     isne $I1, 222, $I3
1024     .CONCAT_RES()
1025     isne $I1, 333, $I3
1026     .CONCAT_RES()
1027     isne $I1, 334, $I3
1028     .CONCAT_RES()
1029     is( res, exp, desc)
1031     res = ''
1032     .RESET_DESC('isne_i_i_ic')
1033     set $I1, 111
1034     set $I2, 222
1035     isne $I1, $I2, 223
1036     .CONCAT_RES()
1037     isne $I1, $I2, 222
1038     .CONCAT_RES()
1039     isne $I1, $I2, 221
1040     .CONCAT_RES()
1041     is( res, exp, desc)
1043     res = ''
1044     .RESET_DESC('isne_i_ic_ic')
1045     set $I1, 111
1046     isne $I1, 222, 223
1047     .CONCAT_RES()
1048     isne $I1, 222, 222
1049     .CONCAT_RES()
1050     isne $I1, 222, 221
1051     .CONCAT_RES()
1052     is( res, exp, desc)
1054     res = ''
1055     .RESET_DESC('isne_i_n_n')
1056     set $I1, 111
1057     set $N2, 2.22
1058     set $N3, 3.33
1059     isne $I1, $N2, $N3
1060     .CONCAT_RES()
1061     set $N2, $N3
1062     isne $I1, $N2, $N3
1063     .CONCAT_RES()
1064     inc $N2
1065     isne $I1, $N2, $N3
1066     .CONCAT_RES()
1067     is( res, exp, desc)
1069     res = ''
1070     .RESET_DESC('isne_i_nc_n')
1071     set $I1, 111
1072     set $N3, 3.33
1073     isne $I1, 2.22, $N3
1074     .CONCAT_RES()
1075     isne $I1, 3.33, $N3
1076     .CONCAT_RES()
1077     isne $I1, 3.34, $N3
1078     .CONCAT_RES()
1079     is( res, exp, desc)
1081     res = ''
1082     .RESET_DESC('isne_i_n_nc')
1083     set $I1, 111
1084     set $N2, 2.22
1085     isne $I1, $N2, 2.23
1086     .CONCAT_RES()
1087     isne $I1, $N2, 2.22
1088     .CONCAT_RES()
1089     isne $I1, $N2, 2.21
1090     .CONCAT_RES()
1091     is( res, exp, desc)
1093     res = ''
1094     .RESET_DESC('isne_i_nc_nc')
1095     set $I1, 111
1096     isne $I1, 2.22, 2.23
1097     .CONCAT_RES()
1098     isne $I1, 2.22, 2.22
1099     .CONCAT_RES()
1100     isne $I1, 2.22, 2.21
1101     .CONCAT_RES()
1102     is( res, exp, desc)
1104     res = ''
1105     .RESET_DESC('isne_i_s_s')
1106     set $I1, 111
1107     set $S2, "Aaa"
1108     set $S3, "Bbb"
1109     isne $I1, $S2, $S3
1110     .CONCAT_RES()
1111     set $S2, $S3
1112     isne $I1, $S2, $S3
1113     .CONCAT_RES()
1114     set $S2, "Ccc"
1115     isne $I1, $S2, $S3
1116     .CONCAT_RES()
1117     is( res, exp, desc)
1119     res = ''
1120     .RESET_DESC('isne_i_sc_s')
1121     set $I1, 111
1122     set $S3, "Bbb"
1123     isne $I1, "Aaa", $S3
1124     .CONCAT_RES()
1125     isne $I1, "Bbb", $S3
1126     .CONCAT_RES()
1127     isne $I1, "Ccc", $S3
1128     .CONCAT_RES()
1129     is( res, exp, desc)
1131     res = ''
1132     .RESET_DESC('isne_i_s_sc')
1133     set $I1, 111
1134     set $S2, "Bbb"
1135     isne $I1, $S2, "Ccc"
1136     .CONCAT_RES()
1137     isne $I1, $S2, "Bbb"
1138     .CONCAT_RES()
1139     isne $I1, $S2, "Aaa"
1140     .CONCAT_RES()
1141     is( res, exp, desc)
1143     res = ''
1144     .RESET_DESC('isne_i_sc_sc')
1145     set $I1, 111
1146     isne $I1, "Bbb", "Ccc"
1147     .CONCAT_RES()
1148     isne $I1, "Bbb", "Bbb"
1149     .CONCAT_RES()
1150     isne $I1, "Bbb", "Aaa"
1151     .CONCAT_RES()
1152     is( res, exp, desc)
1153 .end
1156 .sub 'cmp'
1157     .local string exp, res
1158     .SET_DESC('cmp')
1160   init:
1161     set $I0, 10
1162     cmp $I1, $I0, 9
1163     set $N0, -2.4
1164     cmp $I2, -2.4, $N0
1165     set $S0, "Bruhaha"
1166     cmp $I3, $S0, "Crumbum"
1167     new $P0, 'Integer'
1168     new $P1, 'Integer'
1169     set $P0, 452
1170     set $P1, -15
1171     cmp $I4, $P0, $P1
1174     exp = <<'EXP'
1184   test_it:
1185     $S99 = $I1
1186     concat res, $S99
1187     concat res, "\n"
1188     $S99 = $I2
1189     concat res, $S99
1190     concat res, "\n"
1191     $S99 = $I3
1192     concat res, $S99
1193     concat res, "\n"
1194     $S99 = $I4
1195     concat res, $S99
1196     concat res, "\n"
1198     set $I5, 9
1199     set $I6, 10
1200     set $I7, 11
1201     cmp $I1, $I0, $I5
1202     cmp $I2, $I0, $I6
1203     cmp $I3, $I0, $I7
1204     $S99 = $I1
1205     concat res, $S99
1206     concat res, "\n"
1207     $S99 = $I2
1208     concat res, $S99
1209     concat res, "\n"
1210     $S99 = $I3
1211     concat res, $S99
1212     concat res, "\n"
1214     is(exp, res, desc)
1215 .end
1218 .sub 'cmp_string_null'
1219     .local string s1, s2
1220     .local int r
1221     null s1
1222     s2 = 'hello'
1224     r = cmp s1, s2
1225     is(r, -1, 'cmp snull, snotnull')
1227     r = cmp s2, s1
1228     is(r, 1, 'cmp snotnull, snull')
1230     null s2
1231     r = cmp s2, s1
1232     is(r, 0, 'cmp snull, snull')
1233 .end
1236 .sub 'trac#11'
1237     $P0 = new 'String'
1238     assign $P0, 'foo'
1240     null $P1
1241     $I0 = issame $P0, $P1
1242     is($I0, 0, 'issame String,Null')
1244     $P1 = split ' ', 'parrot speaks your language'
1245     $I0 = issame $P0, $P1
1246     is($I0, 0, 'issame String,ResizableStringArray')
1247 .end
1250 # Local Variables:
1251 #   mode: pir
1252 #   fill-column: 100
1253 # End:
1254 # vim: expandtab shiftwidth=4 ft=pir: