Changeset 67fa9f9 for src/tests


Ignore:
Timestamp:
Jul 5, 2017, 10:50:22 AM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
0614d14
Parents:
11dbfe1 (diff), 307a732 (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

Location:
src/tests
Files:
3 added
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • src/tests/.expect/io.txt

    r11dbfe1 r67fa9f9  
    44123
    55
     6opening delimiters
    67x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «10
    7 1, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x
     8
     9closing delimiters
     101, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x
     11
     12opening/closing delimiters
    813x`1`x'2'x"3"x:4:x 5 x   6       x
    9147
     
    1419x
    152010
    16 x
     21x
     22
     23override opening/closing delimiters
    1724x ( 1 ) x 2 , x 3 :x: 4
     25
     26input bacis types
     27
     28output basic types
    1829A
    19301 2 3 4 5 6 7 8
     
    21321.1+2.3i 1.1-2.3i 1.1-2.3i
    2233
     34tuples
     351, 2, 3 3, 4, 5
     36
     37toggle separator
    23381.11.21.3
    24391.1+2.3i1.1-2.3i1.1-2.3i
    25  abcxyz
    26 abcxyz
     40 abcxyz 
     41abcxyz 
    2742
     43change separator
     44from "  "to " , $"
    28451.1, $1.2, $1.3
    29461.1+2.3i, $1.1-2.3i, $1.1-2.3i
    30 abc, $xyz
     47abc, $xyz, $
     481, 2, 3, $3, 4, 5
    3149
    32 1, 2, 3, 4
    33 1, $2, $3 ", $"
    34 1 2 3 " "
     50from ", $"to " "
     511.1 1.2 1.3
     521.1+2.3i 1.1-2.3i 1.1-2.3i
     53abc xyz
     541, 2, 3 3, 4, 5
     55
     56 1 2 3
     5712 3
    3558 1 2 3
    36 12 3
     591 2 3
     60 1 2 3
     61
    3762123
    38631 23
    39641 2 3
    40 1 2 3 4 " "
    41 1, 2, 3, 4 ", "
    42 1, 2, 3, 4
     65123
     661 2 3
     67123
     681 2 3
     69
     701 2 3 3 4 5 " "
     711, 2, 3 3, 4, 5 ", "
     721, 2, 3 3, 4, 5
     73
    43743, 4, a, 7.2
    44753, 4, a, 7.2
    45763 4 a 7.2
    4677 3 4 a 7.234a7.23 4 a 7.2
    47 3-4-a-7.2^3^4-3-4-a-7.2
     783-4-a-7.2^3^4^3-4-a-7.2
  • src/tests/io.c

    r11dbfe1 r67fa9f9  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Thu Jun  8 09:52:10 2017
    13 // Update Count     : 51
     12// Last Modified On : Sun Jul  2 09:40:58 2017
     13// Update Count     : 68
    1414//
    1515
     
    4242        sout | endl;
    4343
     44        sout | "opening delimiters" | endl;
    4445        sout
    45                 // opening delimiters
    4646                | "x (" | 1
    4747                | "x [" | 2
     
    5454                | "x ¿" | 9
    5555                | "x «" | 10
    56                 | endl;
     56                | endl | endl;
     57
     58        sout | "closing delimiters" | endl;
    5759        sout
    58                 // closing delimiters
    5960                | 1 | ", x"
    6061                | 2 | ". x"
     
    6869                | 10 | "] x"
    6970                | 11 | "} x"
    70                 | endl;
     71                | endl | endl;
     72
     73        sout | "opening/closing delimiters" | endl;
    7174        sout
    72                 // opening-closing delimiters
    7375                | "x`" | 1 | "`x'" | 2
    7476                | "'x\"" | 3 | "\"x:" | 4
     
    7678                | "\tx\f" | 7 | "\fx\v" | 8
    7779                | "\vx\n" | 9 | "\nx\r" | 10
    78                 | "\rx" |
    79                 endl;
     80                | "\rx"
     81                | endl | endl;
     82
     83        sout | "override opening/closing delimiters" | endl;
    8084        sout | "x ( " | 1 | " ) x" | 2 | " , x" | 3 | " :x: " | 4 | endl;
     85        sout | endl;
    8186
    8287        ifstream in;                                                                            // create / open file
    8388        open( &in, "io.data", "r" );
    8489
     90        sout | "input bacis types" | endl;
    8591        &in | &c                                                                                        // character
    8692                | &si | &usi | &i | &ui | &li | &uli | &lli | &ulli     // integral
     
    8894                | &fc | &dc | &ldc                                                              // floating-point complex
    8995                | cstr( s1 ) | cstr( s2, size );                                // C string, length unchecked and checked
     96        sout | endl;
    9097
     98        sout | "output basic types" | endl;
    9199        sout | c | ' ' | endl                                                           // character
    92100                | si | usi | i | ui | li | uli | lli | ulli | endl // integral
     
    94102                | fc | dc | ldc | endl;                                                 // complex
    95103        sout | endl;
     104
     105        sout | "tuples" | endl;
     106        [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 3, [ 4, 5 ] ];
     107        sout | t1 | t2 | endl;                                                          // print tuple
     108        sout | endl;
     109
     110        sout | "toggle separator" | endl;
    96111        sout | f | "" | d | "" | ld | endl                                      // floating point without separator
    97112                | sepDisable | fc | dc | ldc | sepEnable | endl // complex without separator
     
    100115        sout | endl;
    101116
     117        sout | "change separator" | endl;
     118        sout | "from \" " | sepGet( sout ) | "\"";
    102119        sepSet( sout, ", $" );                                                          // change separator, maximum of 15 characters
     120        sout | "to \" " | sepGet( sout ) | "\"" | endl;
    103121        sout | f | d | ld | endl
    104122                | fc | dc | ldc | endl
    105                 | s1 | s2 | endl;
     123                | s1 | s2 | endl
     124                | t1 | t2 | endl;                                                               // print tuple
     125        sout | endl;
     126        sout | "from \"" | sepGet( sout ) | "\"";
     127        sepSet( sout, " " );                                                            // restore separator
     128        sout | "to \"" | sepGet( sout ) | "\"" | endl;
     129        sout | f | d | ld | endl
     130                | fc | dc | ldc | endl
     131                | s1 | s2 | endl
     132                | t1 | t2 | endl;                                                               // print tuple
    106133        sout | endl;
    107134
    108         [int, int] t1 = [1, 2], t2 = [3, 4];
    109         sout | t1 | t2 | endl;                                                          // print tuple
    110 
    111         sepSet( sout, " " );
    112         sepSet( sout, ", $" );                                                          // set separator from " " to ", $"
    113         sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;
    114         sepSet( sout, " " );                                                            // reset separator to " "
    115         sout | 1 | 2 | 3 | " \"" | sepGet( sout ) | "\"" | endl;
    116 
    117         sout | sepOn | 1 | 2 | 3 | sepOn | endl;                        // separator at start of line
     135        sout | sepOn | 1 | 2 | 3 | sepOn | endl;                        // separator at start/end of line
    118136        sout | 1 | sepOff | 2 | 3 | endl;                                       // locally turn off implicit separator
     137        sout | sepOn | 1 | 2 | 3 | sepOn | sepOff | endl;       // separator at start of line
     138        sout | 1 | 2 | 3 | endl | sepOn;                                        // separator at start of next line
     139        sout | 1 | 2 | 3 | endl;
     140        sout | endl;
    119141
    120142        sout | sepDisable | 1 | 2 | 3 | endl;                           // globally turn off implicit separation
    121143        sout | 1 | sepOn | 2 | 3 | endl;                                        // locally turn on implicit separator
    122         sout | sepEnable | 1 | 2 | 3 | endl;                            // globally turn on implicit separation
     144        sout | sepEnable | 1 | 2 | 3 | endl | sepDisable;       // globally turn on/off implicit separation
     145        sout | 1 | 2 | 3 | endl | sepEnable;                            // globally turn on implicit separation
     146        sout | 1 | 2 | 3 | sepOn | sepDisable | endl;           // ignore seperate at end of line
     147        sout | 1 | 2 | 3 | sepOn | sepEnable | endl;            // separator at end of line
     148        sout | 1 | 2 | 3 | endl;
     149        sout | endl;
    123150
    124151        sepSetTuple( sout, " " );                                                       // set tuple separator from ", " to " "
     
    126153        sepSetTuple( sout, ", " );                                                      // reset tuple separator to ", "
    127154        sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"" | endl;
    128 
    129155        sout | t1 | t2 | endl;                                                          // print tuple
     156        sout | endl;
    130157
    131158        [int, int, const char *, double] t3 = { 3, 4, "a", 7.2 };
Note: See TracChangeset for help on using the changeset viewer.