Lumiera  0.pre.03
»edit your freedom«
FormatHelper_test Class Reference

Description

Test:
verifies the proper working of some string-formatting helper functions.
  • util::toString() provides a failsafe to-String conversion, preferring an built-in conversion, falling back to just a type string.
  • util::join() combines elements from arbitrary containers or iterators into a string, relying on aforementioned generic string conversion
    See also
    format-util.hpp

Definition at line 89 of file format-helper-test.cpp.

Private Member Functions

void check2String ()
 
void checkPrefixSuffix ()
 
void checkStringify ()
 
void checkStringJoin ()
 
void run (Arg)
 

Member Function Documentation

◆ check2String()

void check2String ( )
inlineprivate
Test:
verify a failsafe to-string conversion.

Definition at line 104 of file format-helper-test.cpp.

References util::toString().

+ Here is the call graph for this function:

◆ checkStringify()

void checkStringify ( )
inlineprivate
Test:
inline to-string converter function
  • can be used as transforming iterator
  • alternatively accept arbitrary arguments

Definition at line 131 of file format-helper-test.cpp.

References lib::eachNum(), and util::stringify().

+ Here is the call graph for this function:

◆ checkStringJoin()

void checkStringJoin ( )
inlineprivate
Test:
verify delimiter separated joining of arbitrary collections.
  • the first test uses a STL container, which means we need to wrap into a lib::RangeIter. Moreover, lexical_cast is used to convert the double numbers into strings.
  • the second test uses an inline transforming iterator to build a series of AutoCounter objects, which provide a custom string conversion function. Moreover, since the transforming iterator conforms to the Lumiera Forward Iterator concept, we can just move the rvalue into the formatting function without much ado

Definition at line 191 of file format-helper-test.cpp.

References util::join(), and lib::transformIterator().

+ Here is the call graph for this function:

◆ checkPrefixSuffix()

void checkPrefixSuffix ( )
inlineprivate
Test:
convenience helpers to deal with prefixes and suffixes

Definition at line 227 of file format-helper-test.cpp.

References util::endsWith(), and util::startsWith().

+ Here is the call graph for this function:
+ Inheritance diagram for FormatHelper_test:
+ Collaboration diagram for FormatHelper_test:

The documentation for this class was generated from the following file: