Changeset 8cbe732 for tests/io/manipulatorsInput.cfa
- Timestamp:
- Oct 13, 2023, 7:13:21 PM (2 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/io/manipulatorsInput.cfa
r85034ed r8cbe732 45 45 } 46 46 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 50 54 scanf("\n"); // next test does not start with %s so does not tolerate leading whitespace 51 55 } 52 56 { 53 57 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 ); 56 60 scanf( "%s", s ); printf( "2 %s\n", s ); 57 61 scanf( "%*s" ); printf( "3 %s\n", s ); … … 67 71 scanf( "%*8[abc]" ); printf( "12 %s\n", s ); 68 72 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"); 69 81 } 70 82 { … … 85 97 sin | ignore( incl( "abc", wdi( sizeof(s), 8, s ) ) ); sout | "12" | s; 86 98 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"; 87 106 } 88 107 /* Keep harmonized with collections/string-istream-manip */
Note:
See TracChangeset
for help on using the changeset viewer.