2 # Copyright (C) 2001-2009, Parrot Foundation.
7 t/op/string.t - Parrot Strings
15 Tests Parrot string registers and operations.
20 .include 'test_more.pir'
111 eq "hello", $S0, ERROR
114 eq "world", $S0, ERROR
117 eq "hello", $S0, ERROR
120 eq "hellooo", $S0, ERROR
123 eq "hello", $S0, ERROR
126 eq "hella", $S0, ERROR
129 eq "hella", $S0, ERROR
132 eq "hellooo", $S0, ERROR
135 eq "hElLo", $S0, ERROR
138 eq "hElLo", $S0, OK11
141 ok( 1, 'eq_sc_s_ic' )
144 ok( 0, 'eq_sc_s_ic' )
154 eq $S0, "world", ERROR
157 eq $S0, "hello", ERROR
160 eq $S0, "hellooo", ERROR
163 eq $S0, "hello", ERROR
166 eq $S0, "hella", ERROR
169 eq $S0, "hello", ERROR
172 eq $S0, "hellooo", ERROR
175 eq $S0, "hella", ERROR
178 eq $S0, "HeLlO", ERROR
181 eq $S0, "hElLo", OK11
184 ok( 1, 'eq_s_sc_ic' )
187 ok( 0, 'eq_s_sc_ic' )
191 .sub test_eq_sc_sc_ic
192 eq "hello", "hello", OK1
195 eq "hello", "world", ERROR
197 eq "world", "hello", ERROR
199 eq "hello", "hellooo", ERROR
201 eq "hellooo", "hello", ERROR
203 eq "hello", "hella", ERROR
205 eq "hella", "hello", ERROR
207 eq "hella", "hellooo", ERROR
209 eq "hellooo", "hella", ERROR
211 eq "hElLo", "HeLlO", ERROR
213 eq "hElLo", "hElLo", OK11
216 ok( 1, 'eq_sc_sc_ic' )
219 ok( 0, 'eq_sc_sc_ic' )
286 ne "hello", $S0, ERROR
301 ne "hellooo", $S0, OK5
317 ne "hellooo", $S0, OK9
321 ne "hElLo", $S0, OK10
325 ne "hElLo", $S0, ERROR
327 ok( 1, 'ne_sc_s_ic' )
330 ok( 0, 'ne_sc_s_ic' )
336 ne $S0, "hello", ERROR
347 ne $S0, "hellooo", OK4
363 ne $S0, "hellooo", OK8
371 ne $S0, "HeLlO", OK10
375 ne $S0, "hElLo", ERROR
377 ok( 1, 'ne_s_sc_ic' )
380 ok( 0, 'ne_s_sc_ic' )
384 .sub test_ne_sc_sc_ic
385 ne "hello", "hello", ERROR
387 ne "hello", "world", OK2
390 ne "world", "hello", OK3
393 ne "hello", "hellooo", OK4
396 ne "hellooo", "hello", OK5
399 ne "hello", "hella", OK6
402 ne "hella", "hello", OK7
405 ne "hella", "hellooo", OK8
408 ne "hellooo", "hella", OK9
411 ne "hElLo", "HeLlO", OK10
414 ne "hElLo", "hElLo", ERROR
416 ok( 1, 'ne_sc_sc_ic' )
419 ok( 0, 'ne_sc_sc_ic' )
481 lt "hello", $S0, ERROR
488 lt "world", $S0, ERROR
495 lt "hellooo", $S0, ERROR
498 lt "hello", $S0, ERROR
509 lt "hellooo", $S0, ERROR
512 lt "hElLo", $S0, ERROR
515 lt "hElLo", $S0, ERROR
517 ok( 1, 'lt_sc_s_ic' )
520 ok( 0, 'lt_sc_s_ic' )
526 lt $S0, "hello", ERROR
533 lt $S0, "hello", ERROR
536 lt $S0, "hellooo", OK4
540 lt $S0, "hello", ERROR
543 lt $S0, "hella", ERROR
550 lt $S0, "hellooo", OK8
554 lt $S0, "hella", ERROR
557 lt $S0, "HeLlO", ERROR
560 lt $S0, "hElLo", ERROR
562 ok( 1, 'lt_s_sc_ic' )
565 ok( 0, 'lt_s_sc_ic' )
569 .sub test_lt_sc_sc_ic
570 lt "hello", "hello", ERROR
572 lt "hello", "world", OK2
575 lt "world", "hello", ERROR
577 lt "hello", "hellooo", OK4
580 lt "hellooo", "hello", ERROR
582 lt "hello", "hella", ERROR
584 lt "hella", "hello", OK7
587 lt "hella", "hellooo", OK8
590 lt "hellooo", "hella", ERROR
592 lt "hElLo", "HeLlO", ERROR
594 lt "hElLo", "hElLo", ERROR
596 ok( 1, 'lt_sc_sc_ic' )
599 ok( 0, 'lt_sc_sc_ic' )
671 le "world", $S0, ERROR
678 le "hellooo", $S0, ERROR
681 le "hello", $S0, ERROR
692 le "hellooo", $S0, ERROR
695 le "hElLo", $S0, ERROR
698 le "hElLo", $S0, OK11
701 ok( 1, 'le_sc_s_ic' )
704 ok( 0, 'le_sc_s_ic' )
718 le $S0, "hello", ERROR
721 le $S0, "hellooo", OK4
725 le $S0, "hello", ERROR
728 le $S0, "hella", ERROR
735 le $S0, "hellooo", OK8
739 le $S0, "hella", ERROR
742 le $S0, "HeLlO", ERROR
745 le $S0, "hElLo", OK11
748 ok( 1, 'le_s_sc_ic' )
751 ok( 0, 'le_s_sc_ic' )
755 .sub test_le_sc_sc_ic
756 le "hello", "hello", OK1
759 le "hello", "world", OK2
762 le "world", "hello", ERROR
764 le "hello", "hellooo", OK4
767 le "hellooo", "hello", ERROR
769 le "hello", "hella", ERROR
771 le "hella", "hello", OK7
774 le "hella", "hellooo", OK8
777 le "hellooo", "hella", ERROR
779 le "hElLo", "HeLlO", ERROR
781 le "hElLo", "hElLo", OK11
784 ok( 1, 'le_sc_sc_ic' )
787 ok( 0, 'le_sc_sc_ic' )
850 gt "hello", $S0, ERROR
853 gt "hello", $S0, ERROR
860 gt "hello", $S0, ERROR
863 gt "hellooo", $S0, OK5
871 gt "hella", $S0, ERROR
874 gt "hella", $S0, ERROR
877 gt "hellooo", $S0, OK9
881 gt "hElLo", $S0, OK10
885 gt "hElLo", $S0, ERROR
887 ok( 1, 'gt_sc_s_ic' )
890 ok( 0, 'gt_sc_s_ic' )
896 gt $S0, "hello", ERROR
899 gt $S0, "world", ERROR
906 gt $S0, "hellooo", ERROR
917 gt $S0, "hello", ERROR
920 gt $S0, "hellooo", ERROR
927 gt $S0, "HeLlO", OK10
931 gt $S0, "hElLo", ERROR
933 ok( 1, 'gt_s_sc_ic' )
936 ok( 0, 'gt_s_sc_ic' )
940 .sub test_gt_sc_sc_ic
941 gt "hello", "hello", ERROR
943 gt "hello", "world", ERROR
945 gt "world", "hello", OK3
948 gt "hello", "hellooo", ERROR
950 gt "hellooo", "hello", OK5
953 gt "hello", "hella", OK6
956 gt "hella", "hello", ERROR
958 gt "hella", "hellooo", ERROR
960 gt "hellooo", "hella", OK9
963 gt "hElLo", "HeLlO", OK10
966 gt "hElLo", "hElLo", ERROR
968 ok( 1, 'gt_sc_sc_ic' )
971 ok( 0, 'gt_sc_sc_ic' )
1027 ok( 1, 'ge_s_s_ic' )
1030 ok( 0, 'ge_s_s_ic' )
1034 .sub test_ge_sc_s_ic
1036 ge "hello", $S0, OK1
1040 ge "hello", $S0, ERROR
1043 ge "world", $S0, OK3
1047 ge "hello", $S0, ERROR
1050 ge "hellooo", $S0, OK5
1054 ge "hello", $S0, OK6
1058 ge "hella", $S0, ERROR
1061 ge "hella", $S0, ERROR
1064 ge "hellooo", $S0, OK9
1068 ge "hElLo", $S0, OK10
1072 ge "hElLo", $S0, OK11
1075 ok( 1, 'ge_sc_s_ic' )
1078 ok( 0, 'ge_sc_s_ic' )
1082 .sub test_ge_s_sc_ic
1084 ge $S0, "hello", OK1
1088 ge $S0, "world", ERROR
1091 ge $S0, "hello", OK3
1095 ge $S0, "hellooo", ERROR
1098 ge $S0, "hello", OK5
1102 ge $S0, "hella", OK6
1106 ge $S0, "hello", ERROR
1109 ge $S0, "hellooo", ERROR
1112 ge $S0, "hella", OK9
1116 ge $S0, "HeLlO", OK10
1120 ge $S0, "hElLo", OK11
1123 ok( 1, 'ge_s_sc_ic' )
1126 ok( 0, 'ge_s_sc_ic' )
1130 .sub test_ge_sc_sc_ic
1131 ge "hello", "hello", OK1
1134 ge "hello", "world", ERROR
1136 ge "world", "hello", OK3
1139 ge "hello", "hellooo", ERROR
1141 ge "hellooo", "hello", OK5
1144 ge "hello", "hella", OK6
1147 ge "hella", "hello", ERROR
1149 ge "hella", "hellooo", ERROR
1151 ge "hellooo", "hella", OK9
1154 ge "hElLo", "HeLlO", OK10
1157 ge "hElLo", "hElLo", OK11
1160 ok( 1, 'ge_sc_sc_ic' )
1163 ok( 0, 'ge_sc_sc_ic' )
1169 # cperl-indent-level: 4
1172 # vim: expandtab shiftwidth=4 ft=pir :