Changeset a738c68 for tests


Ignore:
Timestamp:
Sep 14, 2023, 10:43:31 AM (8 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
master
Children:
3df4cd9
Parents:
efe420f3
Message:

Update max/min so n-ary version doesn't match against the 2 argument case. Also added a test.

Location:
tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/.expect/minmax.txt

    refe420f3 ra738c68  
    2020double                  4. 3.1  max 4.
    2121long double             4. 3.1  max 4.
     22
     233 arguments
     242 3 4   min 2   max 4
     254 2 3   min 2   max 4
     263 4 2   min 2   max 4
     274 arguments
     283 2 5 4 min 2   max 5
     295 3 4 2 min 2   max 5
  • tests/minmax.cfa

    refe420f3 ra738c68  
    4545        sout | "double\t\t\t"                           | 4.0 | 3.1 | "\tmax" | max( 4.0, 3.1 );
    4646        sout | "long double\t\t"                        | 4.0l | 3.1l | "\tmax" | max( 4.0l, 3.1l );
     47
     48        sout | nl;
     49
     50        sout | "3 arguments";
     51        sout | 2 | 3 | 4 | "\tmin" | min(2, 3, 4) | "\tmax" | max(2, 3, 4);
     52        sout | 4 | 2 | 3 | "\tmin" | min(4, 2, 3) | "\tmax" | max(4, 2, 3);
     53        sout | 3 | 4 | 2 | "\tmin" | min(3, 4, 2) | "\tmax" | max(3, 4, 2);
     54
     55        sout | "4 arguments";
     56        sout | 3 | 2 | 5 | 4 | "\tmin" | min(3, 2, 5, 4) | "\tmax" | max(3, 2, 5, 4);
     57        sout | 5 | 3 | 4 | 2 | "\tmin" | min(5, 3, 4, 2) | "\tmax" | max(5, 3, 4, 2);
    4758} // main
    4859
Note: See TracChangeset for help on using the changeset viewer.