Changeset 53a6c2a for src/tests


Ignore:
Timestamp:
Jul 7, 2017, 10:39:08 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
29038ef
Parents:
52a9004
Message:

change meaning of sepOn, and replace #if with #pragma once in include files

Location:
src/tests
Files:
2 edited

Legend:

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

    r52a9004 r53a6c2a  
    44123
    55
    6 opening delimiters 
     6opening delimiters
    77x (1 x [2 x {3 x =4 x $5 x £6 x ¥7 x ¡8 x ¿9 x «10
    88
    9 closing delimiters 
    10 1, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x 
     9closing delimiters
     101, x 2. x 3; x 4! x 5? x 6% x 7¢ x 8» x 9) x 10] x 11} x
    1111
    12 opening/closing delimiters 
     12opening/closing delimiters
    1313x`1`x'2'x"3"x:4:x 5 x   6       x
    14147
     
    1919x
    202010
    21 x 
     21x
    2222
    23 override opening/closing delimiters 
     23override opening/closing delimiters
    2424x ( 1 ) x 2 , x 3 :x: 4
    2525
    26 input bacis types 
     26input bacis types
    2727
    28 output basic types 
     28output basic types
    2929A
    30301 2 3 4 5 6 7 8
     
    32321.1+2.3i 1.1-2.3i 1.1-2.3i
    3333
    34 tuples 
    35 1, 2, 3 3, 4, 5
     34tuples
     351, 2, 3 4, 5, 6
    3636
    37 toggle separator 
     37toggle separator
    38381.11.21.3
    39391.1+2.3i1.1-2.3i1.1-2.3i
    40  abcxyz
    41 abcxyz
     401.1+2.3i 1.1-2.3i1.1-2.3i
     411.1+2.3i 1.1-2.3i 1.1-2.3i
     421.1+2.3i1.1-2.3i 1.1-2.3i
     43abcxyz
     44abcxyz
    4245
    43 change separator 
    44 from "  "to " , $"
     46change separator
     47from " " to ", $"
    45481.1, $1.2, $1.3
    46491.1+2.3i, $1.1-2.3i, $1.1-2.3i
    47 abc, $xyz, $
    48 1, 2, 3, $3, 4, 5
     50abc, $xyz
     511, 2, 3, $4, 5, 6
    4952
    50 from ", $"to " "
     53from ", $" to " "
    51541.1 1.2 1.3
    52551.1+2.3i 1.1-2.3i 1.1-2.3i
    53 abc xyz 
    54 1, 2, 3 3, 4, 5
     56abc xyz
     571, 2, 3 4, 5, 6
    5558
    56  1 2 3
     59check sepOn/sepOff
     601 2 3
    576112 3
    58  1 2 3
    59621 2 3
    60  1 2 3
     631 2 3
    6164
     651 2 3
     66
     67check enable/disable
    6268123
    63691 23
     
    6571123
    66721 2 3
    67 123 
     73123
    68741 2 3
    6975
    70 1 2 3 3 4 5 " "
    71 1, 2, 3 3, 4, 5 ", "
    72 1, 2, 3 3, 4, 5
     761 2 3 4 5 6 " "
     771, 2, 3 4, 5, 6 " "
     781, 2, 3 4, 5, 6
    7379
    74803, 4, a, 7.2
    75813, 4, a, 7.2
    76823 4 a 7.2
    77  3 4 a 7.234a7.23 4 a 7.2
     833 4 a 7.234a7.23 4 a 7.2
    78843-4-a-7.2^3^4^3-4-a-7.2
  • src/tests/io.c

    r52a9004 r53a6c2a  
    1010// Created On       : Wed Mar  2 16:56:02 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Sun Jul  2 09:40:58 2017
    13 // Update Count     : 68
     12// Last Modified On : Thu Jul  6 23:26:12 2017
     13// Update Count     : 78
    1414//
    1515
     
    104104
    105105        sout | "tuples" | endl;
    106         [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 3, [ 4, 5 ] ];
     106        [int, [ int, int ] ] t1 = [ 1, [ 2, 3 ] ], t2 = [ 4, [ 5, 6 ] ];
    107107        sout | t1 | t2 | endl;                                                          // print tuple
    108108        sout | endl;
     
    110110        sout | "toggle separator" | endl;
    111111        sout | f | "" | d | "" | ld | endl                                      // floating point without separator
    112                 | sepDisable | fc | dc | ldc | sepEnable | endl // complex without separator
    113                 | sepOn | s1 | sepOff | s2 | endl                               // local separator removal
    114                 | s1 | "" | s2 | endl;                                                  // C string without separator
     112                | sepDisable | fc | dc | ldc | endl                             // complex without separator
     113                | fc | sepOn | dc | ldc | endl                                  // local separator add
     114                | sepEnable | fc | dc | ldc | endl                              // complex with separator
     115                | fc | sepOff | dc | ldc | endl                                 // local separator removal
     116                | s1 | sepOff | s2 | endl                                               // local separator removal
     117                | s1 | "" | s2 | endl;                                                  // local separator removal
    115118        sout | endl;
    116119
    117120        sout | "change separator" | endl;
    118         sout | "from \" " | sepGet( sout ) | "\"";
     121        sout | "from \"" | sep | "\"";
    119122        sepSet( sout, ", $" );                                                          // change separator, maximum of 15 characters
    120         sout | "to \" " | sepGet( sout ) | "\"" | endl;
     123        sout | " to \"" | sep | "\"" | endl;
    121124        sout | f | d | ld | endl
    122125                | fc | dc | ldc | endl
     
    124127                | t1 | t2 | endl;                                                               // print tuple
    125128        sout | endl;
    126         sout | "from \"" | sepGet( sout ) | "\"";
     129        sout | "from \"" | sep | "\" ";
    127130        sepSet( sout, " " );                                                            // restore separator
    128         sout | "to \"" | sepGet( sout ) | "\"" | endl;
     131        sout | "to \"" | sep | "\"" | endl;
    129132        sout | f | d | ld | endl
    130133                | fc | dc | ldc | endl
     
    133136        sout | endl;
    134137
    135         sout | sepOn | 1 | 2 | 3 | sepOn | endl;                        // separator at start/end of line
     138        sout | "check sepOn/sepOff" | endl;
     139        sout | sepOn | 1 | 2 | 3 | sepOn | endl;                        // no separator at start/end of line
    136140        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
     141        sout | sepOn | sepOn | 1 | 2 | 3 | sepOn | sepOff | sepOn | '\n'; // no separator at start/end of line
     142        sout | 1 | 2 | 3 | "\n\n" | sepOn;                                      // no separator at start of next line
    139143        sout | 1 | 2 | 3 | endl;
    140144        sout | endl;
    141145
     146        sout | "check enable/disable" | endl;
    142147        sout | sepDisable | 1 | 2 | 3 | endl;                           // globally turn off implicit separation
    143148        sout | 1 | sepOn | 2 | 3 | endl;                                        // locally turn on implicit separator
     
    149154        sout | endl;
    150155
     156//      sout | fmt( d, "%8.3f" ) || endl;
     157//      sout | endl;
     158
    151159        sepSetTuple( sout, " " );                                                       // set tuple separator from ", " to " "
    152         sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"" | endl;
     160        sout | t1 | t2 | " \"" | sep | "\"" | endl;
    153161        sepSetTuple( sout, ", " );                                                      // reset tuple separator to ", "
    154         sout | t1 | t2 | " \"" | sepGetTuple( sout ) | "\"" | endl;
     162        sout | t1 | t2 | " \"" | sep | "\"" | endl;
    155163        sout | t1 | t2 | endl;                                                          // print tuple
    156164        sout | endl;
Note: See TracChangeset for help on using the changeset viewer.