Ignore:
Timestamp:
Dec 3, 2021, 3:33:02 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
4c26a94
Parents:
8e658241
Message:

Added more testing of the range iterator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/algorithms/range_test.cfa

    r8e658241 rdb87a35  
    1717#include <algorithms/range_iterator.hfa>
    1818
     19void print(const char * range){
     20        RangeIter r = { range };
     21        while(moveNext(r)) {
     22                sout | r.com | nonl;
     23        }
     24        sout | nl;
     25}
     26
    1927int main() {
    20         {
    21                 RangeIter r = { "0-6" };
    22                 while(moveNext(r)) {
    23                         sout | r.com | nonl;
    24                 }
    25                 sout | nl;
    26         }
     28        print("0-6");
     29        print("0");
     30        print("0-6,22-30");
     31        print("0,2,4,6,8,10");
     32        print("0-6,8-14,16,32");
     33        print("0-4,6,8-12,14,16-20");
    2734}
Note: See TracChangeset for help on using the changeset viewer.