Changeset 283876d


Ignore:
Timestamp:
Aug 12, 2022, 9:07:28 AM (19 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
082af5b
Parents:
dbedd71
Message:

update loop tests and expected output for corrected @ usage for negative range

Location:
tests
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tests/.expect/loop_else.txt

    rdbedd71 r283876d  
    37373 6 9 else
    3838
     390 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4 else
     400 -5 1 -6 2 -7 3 -8 4 -9 5 -10 6 -11 7 -12 8 -13 9 -14 else
     410 -5 1 -3 2 -1 3 1 4 3 5 5 6 7 7 9 8 11 9 13 else
     420 -5 1 -7 2 -9 3 -11 4 -13 5 -15 6 -17 7 -19 8 -21 9 -23 else
     43
     440 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4 else
     450 -5 1 -6 2 -7 3 -8 4 -9 5 -10 6 -11 7 -12 8 -13 9 -14 else
     460 -5 1 -3 2 -1 3 1 4 3 5 5 6 7 7 9 8 11 9 13 else
     470 -5 1 -7 2 -9 3 -11 4 -13 5 -15 6 -17 7 -19 8 -21 9 -23 else
     48
     490 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 else
     500 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 else
     510 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 else
    3952(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else
    4053(0 0)(1 1)(2 2)(3 3)(4 4)(5 5)(6 6)(7 7)(8 8)(9 9)else
     
    5063(10 10)(9 9)(8 8)(7 7)(6 6)(5 5)(4 4)(3 3)(2 2)(1 1)(0 0)else
    5164
    52 0 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4 else
    53 0 -5 1 -6 2 -7 3 -8 4 -9 5 -10 6 -11 7 -12 8 -13 9 -14 else
    54 0 -5 1 -3 2 -1 3 1 4 3 5 5 6 7 7 9 8 11 9 13 else
    55 0 -5 1 -7 2 -9 3 -11 4 -13 5 -15 6 -17 7 -19 8 -21 9 -23 else
    56 
    57 0 -5 1 -4 2 -3 3 -2 4 -1 5 0 6 1 7 2 8 3 9 4 else
    58 0 -5 1 -6 2 -7 3 -8 4 -9 5 -10 6 -11 7 -12 8 -13 9 -14 else
    59 0 -5 1 -3 2 -1 3 1 4 3 5 5 6 7 7 9 8 11 9 13 else
    60 0 -5 1 -7 2 -9 3 -11 4 -13 5 -15 6 -17 7 -19 8 -21 9 -23 else
    61 
    62 0 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 else
    63 0 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 else
    64 0 -5 1.5 1 -7 2.5 2 -9 3.5 3 -11 4.5 4 -13 5.5 5 -15 6.5 6 -17 7.5 7 -19 8.5 8 -21 9.5 9 -23 10.5 else
  • tests/loop_else.cfa

    rdbedd71 r283876d  
    5252                sout | i;
    5353        } else { sout | "else"; }                                                                                                               sout | nl;
    54         for ( i; 10 -~ @ ) {
     54        for ( i; @ -~ 10 ) {
    5555          if ( i < 0 ) break;
    5656                sout | i;
     
    6565                i += 1.7;
    6666        } else { sout | "else"; }                                                                                                               sout | nl;
    67         for ( i; 10 -~ @ ~ 2 ) {
     67        for ( i; @ -~ 10 ~ 2 ) {
    6868          if ( i < 0 ) break;
    6969                sout | i;
     
    8484        for ( i; start ~ comp ~ inc + 1 ) { sout | i; } else { sout | "else"; }         sout | nl | nl;
    8585
     86        for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } else { sout | "else"; } sout | nl;
     87        for ( i; 10 : j; @ -~ -5 ) { sout | i | j; } else { sout | "else"; } sout | nl;
     88        for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl;
     89        for ( i; 10 : j; @ -~ -5 ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl;
     90
     91        for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
     92        for ( j; @ -~ -5 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
     93        for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
     94        for ( j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl;
     95
     96        for ( j; @ -~ -5 ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
     97        for ( j; @ -~ -5 ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
     98        for ( k; 1.5 ~ @ : j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
     99
    86100        for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } else { sout | "else"; } sout | nl;
    87101        for ( s; (S){10,10} ) { sout | s; } else { sout | "else"; } sout | nl;
     
    96110        for ( s; (S){0} -~= (S){10,10} ) { sout | s; } else { sout | "else"; }           sout | nl;
    97111        for ( s; (S){0} -~= (S){10,10} ~ (S){1} ) { sout | s; } else { sout | "else"; } sout | nl | nl;
    98 
    99         for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } else { sout | "else"; } sout | nl;
    100         for ( i; 10 : j; -5 -~ @ ) { sout | i | j; } else { sout | "else"; } sout | nl;
    101         for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl;
    102         for ( i; 10 : j; -5 -~ @ ~ 2 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl;
    103 
    104         for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
    105         for ( j; -5 -~ @ : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
    106         for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl;
    107         for ( j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j; } else { sout | "else"; } sout | nl | nl;
    108 
    109         for ( j; -5 -~ @ ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
    110         for ( j; -5 -~ @ ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
    111         for ( k; 1.5 ~ @ : j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j | k; } else { sout | "else"; } sout | nl;
    112112}
  • tests/loopctrl.cfa

    rdbedd71 r283876d  
    1010// Created On       : Wed Aug  8 18:32:59 2018
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Aug  9 20:42:27 2022
    13 // Update Count     : 145
     12// Last Modified On : Thu Aug 11 23:04:35 2022
     13// Update Count     : 160
    1414//
    1515
     
    7070
    7171        for ( j; s ~ @ ) { if ( j == 10 ) break; sout | j; }                            sout | nl;
    72         for ( j; s -~ @ ) { if ( j == -10 ) break; sout | j; }                          sout | nl;
     72        for ( j; @ -~ s ) { if ( j == -10 ) break; sout | j; }                          sout | nl;
    7373        for ( j; s ~ @ ~ i ) { if ( j == 10 ) break; sout | j; }                        sout | nl;
    74         for ( j; s -~ @ ~ i ) { if ( j == -10 ) break; sout | j; }                      sout | nl;
     74        for ( j; @ -~ s ~ i ) { if ( j == -10 ) break; sout | j; }                      sout | nl;
    7575        for ( j; s ~ @ ~ @ ) { if ( j == 10 ) break; sout | j; j += 1; }        sout | nl;
    7676
    7777        for ( int j; s ~ @ ) { if ( j == 10 ) break; sout | j; j += 1; }        sout | nl;
    78         for ( int j; s -~ @ ) { if ( j == -10 ) break; sout | j; j -= 1; }      sout | nl;
     78        for ( int j; @ -~ s ) { if ( j == -10 ) break; sout | j; j -= 1; }      sout | nl;
    7979        for ( int j; s ~ @ ~ i ) { if ( j == 10 ) break; sout | j; }            sout | nl;
    80         for ( int j; s -~ @ ~ i ) { if ( j == -10 ) break; sout | j; }          sout | nl;
     80        for ( int j; @ -~ s ~ i ) { if ( j == -10 ) break; sout | j; }          sout | nl;
    8181        for ( int j; s ~ @ ~ @ ) { if ( j == 10 ) break; sout | j; j += 1; } sout | nl;
    8282
     
    138138                sout | i;
    139139        }                                                                                                       sout | nl;
    140         for ( i; 10 -~ @ ) {
     140        for ( i; @ -~ 10 ) {
    141141          if ( i < 0 ) break;
    142142                sout | i;
     
    151151                i += 1.7;
    152152        }                                                                                                       sout | nl;
    153         for ( i; 10 -~ @ ~ 2 ) {
     153        for ( i; @ -~ 10 ~ 2 ) {
    154154          if ( i < 0 ) break;
    155155                sout | i;
     
    164164        for ( N ) { sout | "N"; }                                                       sout | nl;
    165165        for ( i; N ) { sout | i; }                                                      sout | nl;
    166         for ( i; ~=  N ) { sout | i; }                                          sout | nl;
     166        for ( i; ~= N ) { sout | i; }                                           sout | nl;
    167167        for ( i; -~= N ) { sout | i; }                                          sout | nl | nl;
    168168
     
    171171
    172172        for ( i; 10 : j; -5 ~ @ ) { sout | i | j; } sout | nl;
    173         for ( i; 10 : j; -5 -~ @ ) { sout | i | j; } sout | nl;
     173        for ( i; 10 : j; @ -~ -5 ) { sout | i | j; } sout | nl;
    174174        for ( i; 10 : j; -5 ~ @ ~ 2 ) { sout | i | j; } sout | nl;
    175         for ( i; 10 : j; -5 -~ @ ~ 2 ) { sout | i | j; } sout | nl | nl;
     175        for ( i; 10 : j; @ -~ -5 ~ 2 ) { sout | i | j; } sout | nl | nl;
    176176
    177177        for ( j; -5 ~ @ : i; 10 ) { sout | i | j; } sout | nl;
    178         for ( j; -5 -~ @ : i; 10 ) { sout | i | j; } sout | nl;
     178        for ( j; @ -~ -5 : i; 10 ) { sout | i | j; } sout | nl;
    179179        for ( j; -5 ~ @ ~ 2 : i; 10 ) { sout | i | j; } sout | nl;
    180         for ( j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j; } sout | nl | nl;
    181 
    182         for ( j; -5 -~ @ ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } sout | nl;
    183         for ( j; -5 -~ @ ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } sout | nl;
    184         for ( k; 1.5 ~ @ : j; -5 -~ @ ~ 2 : i; 10 ) { sout | i | j | k; } sout | nl;
     180        for ( j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j; } sout | nl | nl;
     181
     182        for ( j; @ -~ -5 ~ 2 : i; 10 : k; 1.5 ~ @ ) { sout | i | j | k; } sout | nl;
     183        for ( j; @ -~ -5 ~ 2 : k; 1.5 ~ @ : i; 10 ) { sout | i | j | k; } sout | nl;
     184        for ( k; 1.5 ~ @ : j; @ -~ -5 ~ 2 : i; 10 ) { sout | i | j | k; } sout | nl;
    185185
    186186        for ( S s = (S){0}; s < (S){10,10}; s += (S){1} ) { sout | s; } sout | nl;
Note: See TracChangeset for help on using the changeset viewer.