%description: Tests the EnumStringIterator class in common, used to expand run lists. %includes: #include using namespace omnetpp::common; %global: static void expand(const char *runFilter) { EV << "\"" << runFilter << "\" ->"; EnumStringIterator it(runFilter); while (true) { int runNumber = it(); if (runNumber == -1) break; EV << " " << runNumber; it++; } if (it.hasError()) EV << " ERROR"; EV << endl; } %activity: expand("1,8,10..15,20"); // general syntax, ".." for range expand("1,8,10-15,20"); // "-" for range expand("1 , 8 ,10 -15 , 20 "); // whitespace expand("3"); expand("3..6"); expand("3..3"); // one-element range expand("3..2"); // empty range expand("3..2,10"); // empty range, followed by something expand("1,3..2,10..12"); EV << ".\n"; %contains: stdout "1,8,10..15,20" -> 1 8 10 11 12 13 14 15 20 "1,8,10-15,20" -> 1 8 10 11 12 13 14 15 20 "1 , 8 ,10 -15 , 20 " -> 1 8 10 11 12 13 14 15 20 "3" -> 3 "3..6" -> 3 4 5 6 "3..3" -> 3 "3..2" -> "3..2,10" -> 10 "1,3..2,10..12" -> 1 10 11 12 .