Changeset ff56dd2e for tests/collections


Ignore:
Timestamp:
Sep 5, 2023, 4:08:32 PM (16 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master
Children:
737988b
Parents:
3c7e3c4
Message:

Duplicate manipulator read-to-string code for string_res, and test.

Location:
tests/collections
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • tests/collections/.expect/string-istream-manip.txt

    r3c7e3c4 rff56dd2e  
    121212 wwwwwwww
    131313 wwwwwwww
     141 yyyyyyyyyyyyyyyyyyyy
     152 abcxxx
     163 abcxxx
     174 aaaaaaaa
     185 aaaaaaaa
     196 aabbccbb
     207 dddwww
     218 dddwww
     229 dddwww
     2310 aaaaaaaa
     2411 wwwwwwww
     2512 wwwwwwww
     2613 wwwwwwww
  • tests/collections/.in/string-istream-manip.txt

    r3c7e3c4 rff56dd2e  
    55abcyyy
    66aaaaaaaaxxxxxxxxaabbccbbdddwwwbbbbbbbbwwwwwwwwaaaaaaaawwwwwwww
     7abc
     8abc
     9xx
     10abcxxx
     11abcyyy
     12aaaaaaaaxxxxxxxxaabbccbbdddwwwbbbbbbbbwwwwwwwwaaaaaaaawwwwwwww
  • tests/collections/string-istream-manip.cfa

    r3c7e3c4 rff56dd2e  
    22#include <fstream.hfa>
    33#include <collections/string.hfa>
     4#include <collections/string_res.hfa>
    45
    56int main() {
     
    2324        sin | ignore( excl( "abc", wdi( 8, s ) ) );     sout | "13" | s;
    2425    }
     26    {
     27        string_res s = "yyyyyyyyyyyyyyyyyyyy";
     28        char sk[] = "abc";
     29        sin | "abc " | skip( sk ) | skip( 5 );          sout | "1" | s;
     30        sin | s;                                        sout | "2" | s;
     31        sin | ignore( s );                              sout | "3" | s;
     32        sin | wdi( 8, s );                              sout | "4" | s;
     33        sin | ignore( wdi( 8, s ) );                    sout | "5" | s;
     34
     35        sin | incl( "abc", s );                         sout | "6" | s;
     36        sin | excl( "abc", s );                         sout | "7" | s;
     37        sin | ignore( incl( "abc", s ) );               sout | "8" | s;
     38        sin | ignore( excl( "abc", s ) );               sout | "9" | s;
     39        sin | incl( "abc", wdi( 8, s ) );               sout | "10" | s;
     40        sin | excl( "abc", wdi( 8, s ) );               sout | "11" | s;
     41        sin | ignore( incl( "abc", wdi( 8, s ) ) );     sout | "12" | s;
     42        sin | ignore( excl( "abc", wdi( 8, s ) ) );     sout | "13" | s;
     43    }
    2544}
Note: See TracChangeset for help on using the changeset viewer.