Ignore:
Timestamp:
Aug 21, 2025, 9:37:40 PM (5 weeks ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
master
Children:
1324fde
Parents:
7ea4073
Message:

add tests for string include/exclusde with C character-class functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/collections/string-api-coverage.cfa

    r7ea4073 r01e6bd9  
    22#include <string_sharectx.hfa>
    33#include <fstream.hfa>
    4 
     4#include <ctype.h>                                                                              // isxdigit, ispunct, isupper
    55
    66// Purpose: call each function in string.hfa, top to bottom
     
    407407        | (return string)include( alphabet, cc_alphabet )  // "abcdefghijklmnopqrstuvwxyz"
    408408        | (return string)exclude( alphabet, cc_alphabet ); // ""
     409
     410        sout
     411                | (return size_t)include( "1FeC34aB", isxdigit )
     412                | (return size_t)include( ".,;’!\"", ispunct )
     413                | (return size_t)include( "XXXx", isupper );
     414
     415        sout
     416                | (return string)include( "1FeC34aB", isxdigit )
     417                | (return string)include( ".,;’!\"", ispunct )
     418                | (return string)include( "XXXx", isupper );
     419
     420        sout
     421                | (return size_t)exclude( "1FeC34aB", isdigit )
     422                | (return size_t)exclude( ".,;’!\"", ispunct )
     423                | (return size_t)exclude( "XXXx", islower );
     424
     425        sout
     426                | (return string)exclude( "1FeC34aB", isalpha )
     427                | (return string)exclude( ".,;’!\"", ispunct )
     428                | (return string)exclude( "XXXx", islower );
    409429}
Note: See TracChangeset for help on using the changeset viewer.