Changeset 9aa8dcc


Ignore:
Timestamp:
Apr 2, 2025, 11:14:44 PM (6 months ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
c5e1aa6
Parents:
ee70ff5
Message:

update test programs with new length name "len"

Location:
tests/collections
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • tests/collections/string-api-coverage.cfa

    ree70ff5 r9aa8dcc  
    159159
    160160
    161     sout | size(s); // 5
     161    sout | len(s); // 5
    162162
    163163    //
  • tests/collections/string-gc.cfa

    ree70ff5 r9aa8dcc  
    1212
    1313void prtStrRep(const char * label, string_res & s) {
    14     sout | label | "from" | heapOffsetStart(s) | "to" | (heapOffsetStart(s) + size(s));
     14    sout | label | "from" | heapOffsetStart(s) | "to" | (heapOffsetStart(s) + len(s));
    1515}
    1616#define PRT_STR_REP(s) prtStrRep( #s, s )
     
    2929    // x and padder overlap
    3030    sout | "--A";
    31     sout | "length of x:" | size(x);
     31    sout | "length of x:" | len(x);
    3232    PRT_STR_REP(padder);
    3333    PRT_STR_REP(x);
     
    3939    // x and padder still overlap; now x is huge
    4040    sout | "--B";
    41     sout | "length of x:" | size(x);
     41    sout | "length of x:" | len(x);
    4242    PRT_STR_REP(padder);
    4343    PRT_STR_REP(x);
     
    5353
    5454    // want the next edit to straddle the bound
    55     assert( bytesRemaining() < size(padder) );
     55    assert( bytesRemaining() < len(padder) );
    5656
    5757    sout | "--D";
  • tests/collections/string-istream-manip.cfa

    ree70ff5 r9aa8dcc  
    4545                                sin | s;
    4646                                sout | casename | s;
    47                         } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     47                        } while ( len(s) > 0 && s[len(s)-1] != 'x' );
    4848                }
    4949                echoTillX("preS1");
     
    6060                                sin | plainjane( s );
    6161                                sout | casename | s;
    62                         } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     62                        } while ( len(s) > 0 && s[len(s)-1] != 'x' );
    6363                }
    6464                echoTillX("preSMN1");
     
    7575                                sin | plainjane( s );
    7676                                sout | casename | s;
    77                         } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     77                        } while ( len(s) > 0 && s[len(s)-1] != 'x' );
    7878                }
    7979                echoTillX("preRMN1");
     
    9191                                sin | incl( ".:|# x", s );
    9292                                sout | casename | " \"" | s | "\"";
    93                         } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     93                        } while ( len(s) > 0 && s[len(s)-1] != 'x' );
    9494                }
    9595                echoTillX("preSMI1");
     
    107107                                sin | excl( "-\n", s );
    108108                                sout | casename | " \"" | s | "\"";
    109                         } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     109                        } while ( len(s) > 0 && s[len(s)-1] != 'x' );
    110110                }
    111111                echoTillX("preSME1");
     
    123123                                sin | getline( s );
    124124                                sout | casename | s;
    125                         } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     125                        } while ( len(s) > 0 && s[len(s)-1] != 'x' );
    126126                }
    127127                echoTillX("preSMG1");
     
    138138                                sin | getline( s, '@' );
    139139                                sout | casename | s;
    140                         } while ( size(s) > 0 && s[size(s)-1] != 'x' );
     140                        } while ( len(s) > 0 && s[len(s)-1] != 'x' );
    141141                        sin | skip(" \n");
    142142                }
  • tests/collections/string-istream.cfa

    ree70ff5 r9aa8dcc  
    3737    for(;;) {
    3838        sin | si;
    39       if (size(si) > 0 && si[0] == '=') break;
     39      if (len(si) > 0 && si[0] == '=') break;
    4040        sout | si;    step_otherStringAction();
    4141    }
     
    5050    for(;;) {
    5151        sin | si;
    52       if (size(si) > 0 && si[0] == '=') break;
     52      if (len(si) > 0 && si[0] == '=') break;
    5353        sout | si;    step_otherStringAction();
    5454    }
  • tests/collections/string-overwrite.cfa

    ree70ff5 r9aa8dcc  
    7878    int we = ws + wl;
    7979
    80     assert( ms >= 0 && ms <= me && me <= size(s) );
    81     assert( ws >= 0 && ws <= we && we <= size(s) );
     80    assert( ms >= 0 && ms <= me && me <= len(s) );
     81    assert( ws >= 0 && ws <= we && we <= len(s) );
    8282
    8383    string mod = s(ms, ml)`share;
     
    9292    // visualize the pair of ranges
    9393    sout | nlOff;
    94     for ( i; size(s) ) {
     94    for ( i; len(s) ) {
    9595        if( i < ms || i > me ) {
    9696            sout | ' ';
     
    102102        }
    103103    } sout | nl;
    104     for ( i; size(s) ) {
     104    for ( i; len(s) ) {
    105105        if( i < ws || i > we ) {
    106106            sout | ' ';
     
    116116
    117117    mod = replaceWith;    // main replacement
    118     sout | s | "( wit = " | wit | "witlen = " | size(wit) | " )";
     118    sout | s | "( wit = " | wit | "witlen = " | len(wit) | " )";
    119119    wit = "?";            // witness-revelaing replacement
    120120    sout | s;
Note: See TracChangeset for help on using the changeset viewer.