Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/collections/string-overwrite.cfa

    r0ca15b7 r6cc87c0  
    11#include <containers/string.hfa>
    2 #include <string_sharectx.hfa>
    32
    43/*
     
    1211WE = witness end
    1312
    14 The test does:
     13The dest does:
    1514  starts with the entire string being, initially, the alphabet; prints this entire alphabet
    1615  sets up modifier and witness as ranges within it, and prints a visualization of those ranges
     
    2524This API's convention has Start positions being inclusive and end positions being exclusive.
    2625
    27                                 v Case number in output
    2826With 1 equivalence class:
    2927MS = ME = WS = WE               1
     
    120118    struct { int ms; int me; int ws; int we; char *replaceWith; char *label; } cases[] = {
    121119        { 12, 14, 10, 20, "xxxxx", "warmup" },
     120//        { 12, 14, 12, 14, "xxxxx", ""       },  // the bug that got me into this test (should be a dup with case 6)
    122121        { 10, 10, 10, 10, "=====", "1"      },
    123122        { 10, 10, 10, 10, "=="   , ""       },
     
    224223        { 12, 14, 10, 16, "="    , ""       },
    225224        { 12, 14, 10, 16, ""     , ""       },
     225/*
     226        { , , , , "=====", "NN"     },
     227        {  "=="   , ""       },
     228        {  "="    , ""       },
     229        {  ""     , ""       },
     230*/
    226231    };
    227232    for ( i; sizeof(cases)/sizeof(cases[0]) ) {
     
    233238
    234239
     240// void f( string & s, string & toEdit ) {
     241
     242//     sout | s | "|" | toEdit | "|";
     243
     244//     s(14, 16) = "-";
     245//     sout | s | "|" | toEdit | "|";
     246// }
     247
    235248int main() {
    236 
    237     #ifdef STRING_SHARING_OFF
    238     string_sharectx c = { NO_SHARING };
    239     #endif
    240 
    241 
    242249    //          0         1         2
    243250    //          01234567890123456789012345
Note: See TracChangeset for help on using the changeset viewer.