Ignore:
Timestamp:
Oct 13, 2023, 7:13:21 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
master
Children:
a97b9ed, bab2917
Parents:
85034ed (diff), 0bf0b978 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/io/manipulatorsInput.cfa

    r85034ed r8cbe732  
    4545                }
    4646
    47                 rep("pre1");
    48                 rep("pre2a");
    49                 rep("pre2b");
     47                rep("pre1");    // 123456     |  123456
     48                rep("pre2");    // 1234567    |  1234567
     49                rep("pre3a");   // 12345678   |  1234567
     50                rep("pre3b");   //            |  8
     51                rep("pre4a");   // 123456789  |  1234567
     52                rep("pre4b");   //            |  89
     53
    5054                scanf("\n");  // next test does not start with %s so does not tolerate leading whitespace
    5155        }
    5256        {
    5357                char s[] = "yyyyyyyyyyyyyyyyyyyy";
    54                 const char sk[] = "abc";
    55                 scanf( "abc " ); scanf( sk ); for ( 5 ) scanf( "%*c" ); printf( "1 %s\n", s );
     58                const char sk_fmt[] = "%*[abc]";
     59                scanf( "abc " ); scanf( sk_fmt ); for ( 5 ) scanf( "%*c" ); printf( "1 %s\n", s );
    5660                scanf( "%s", s );                                                               printf( "2 %s\n", s );
    5761                scanf( "%*s" );                                                                 printf( "3 %s\n", s );
     
    6771                scanf( "%*8[abc]" );                                                    printf( "12 %s\n", s );
    6872                scanf( "%*8[^abc]" );                                                   printf( "13 %s\n", s );
     73
     74                int rc;
     75                s[0] = 'q'; s[1] = '\0'; rc = 99;
     76                rc = scanf( "%[abc]", s );                                              printf( "14 rc=%d, %s\n", rc, s );
     77                s[0] = 'q'; s[1] = '\0'; rc = 99;
     78                rc = scanf( "%[^u]", s );                                               printf( "15 rc=%d, %s\n", rc, s );
     79                scanf( "%*[u]" );
     80                scanf("\n");
    6981        }
    7082        {
     
    8597                sin | ignore( incl( "abc", wdi( sizeof(s), 8, s ) ) ); sout | "12" | s;
    8698                sin | ignore( excl( "abc", wdi( sizeof(s), 8, s ) ) ); sout | "13" | s;
     99
     100                s[0] = 'q'; s[1] = '\0';
     101                sin | incl( "abc", wdi( sizeof(s), s ) );               sout | "14" | s;
     102                s[0] = 'q'; s[1] = '\0';
     103                sin | excl( "u", wdi( sizeof(s), s ) );                 sout | "15" | s;
     104                sin | skip( "u" );
     105                sin | "\n";
    87106        }
    88107    /* Keep harmonized with collections/string-istream-manip */
Note: See TracChangeset for help on using the changeset viewer.