Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
ah-string-utils.cc File Reference

Tests for Ah String Utils. More...

#include <gtest/gtest.h>
#include <cstdlib>
#include <limits>
#include <random>
#include <stdexcept>
#include <vector>
#include <ah-string-utils.H>
Include dependency graph for ah-string-utils.cc:

Go to the source code of this file.

Functions

 TEST (util, concat)
 
 TEST (StringUtils, vector_to_string)
 
 TEST (StringUtils, array_to_string)
 
 TEST (StringUtils, trim_variants)
 
 TEST (StringUtils, contains_string_view)
 
 TEST (StringUtils, double_formatting)
 
 TEST (StringUtils, case_conversion_ascii)
 
 TEST (StringUtils, case_conversion_non_ascii_does_not_crash)
 
 TEST (StringUtils, only_alpha_and_removals)
 
 TEST (StringUtils, join_dynlist)
 
 TEST (StringUtils, numeric_parsers)
 
 TEST (StringUtils, prefix_and_remove_prefix)
 
 TEST (StringUtils, to_name)
 
 TEST (StringUtils, split_camel_case)
 
 TEST (StringUtils, split_and_split_string)
 
 TEST (StringUtils, pascal_case)
 
 TEST (StringUtils, split_pos)
 
 TEST (StringUtils, split_n)
 
 TEST (StringUtils, complete_rows)
 
 TEST (StringUtils, format_string_no_underflow)
 
 TEST (StringUtils, format_string_csv)
 
 TEST (StringUtils, text_wrapping_and_shift)
 
 TEST (StringUtils, build_pars_list_variadic)
 
 TEST (StringUtils, build_pars_list_container)
 
 TEST (StringUtils, fill_string)
 
 TEST (StringUtils, split_to_array)
 
 TEST (StringUtils, format_string_computed_lens)
 
 TEST (StringUtils, to_string_matrix_and_lines)
 
 TEST (StringUtils, split_text_into_words_and_lines)
 
 TEST (StringUtils, justify_and_align_except_first)
 
 TEST (StringUtils, numeric_boundaries)
 
static int stress_multiplier ()
 
static string random_string (std::mt19937 &rng, size_t len)
 
static string random_ascii_token (std::mt19937 &rng, size_t len)
 
 TEST (StringUtilsStress, split_pos_recomposes)
 
 TEST (StringUtilsStress, split_n_recomposes)
 
 TEST (StringUtilsStress, split_string_tokens_have_no_delims)
 
 TEST (StringUtilsStress, case_conversion_no_crash_and_preserves_length)
 
 TEST (StringUtilsStress, build_pars_list_round_trip_for_ints)
 

Detailed Description

Tests for Ah String Utils.

Definition in file ah-string-utils.cc.

Function Documentation

◆ random_ascii_token()

static string random_ascii_token ( std::mt19937 &  rng,
size_t  len 
)
static

Definition at line 476 of file ah-string-utils.cc.

References Aleph::maps(), and rng.

Referenced by TEST(), TEST(), and TEST().

◆ random_string()

static string random_string ( std::mt19937 &  rng,
size_t  len 
)
static

Definition at line 466 of file ah-string-utils.cc.

References Aleph::maps(), and rng.

Referenced by TEST(), TEST(), TEST(), and TEST().

◆ stress_multiplier()

static int stress_multiplier ( )
static

Definition at line 446 of file ah-string-utils.cc.

References Aleph::maps().

Referenced by TEST(), TEST(), TEST(), TEST(), and TEST().

◆ TEST() [1/36]

TEST ( StringUtils  ,
array_to_string   
)

Definition at line 73 of file ah-string-utils.cc.

References Aleph::Array< T >::append(), Aleph::maps(), and Aleph::to_string().

◆ TEST() [2/36]

TEST ( StringUtils  ,
build_pars_list_container   
)

◆ TEST() [3/36]

TEST ( StringUtils  ,
build_pars_list_variadic   
)

Definition at line 338 of file ah-string-utils.cc.

References Aleph::build_pars_list(), and Aleph::maps().

◆ TEST() [4/36]

TEST ( StringUtils  ,
case_conversion_ascii   
)

◆ TEST() [5/36]

TEST ( StringUtils  ,
case_conversion_non_ascii_does_not_crash   
)

Definition at line 132 of file ah-string-utils.cc.

References Aleph::maps(), Aleph::HTList::size(), and Aleph::to_lower().

◆ TEST() [6/36]

TEST ( StringUtils  ,
complete_rows   
)

◆ TEST() [7/36]

TEST ( StringUtils  ,
contains_string_view   
)

Definition at line 105 of file ah-string-utils.cc.

References Aleph::contains(), and Aleph::maps().

◆ TEST() [8/36]

TEST ( StringUtils  ,
double_formatting   
)

Definition at line 112 of file ah-string-utils.cc.

References Aleph::maps(), Aleph::to_str(), and Aleph::to_string().

◆ TEST() [9/36]

TEST ( StringUtils  ,
fill_string   
)

Definition at line 355 of file ah-string-utils.cc.

References Aleph::fill_string(), and Aleph::maps().

◆ TEST() [10/36]

TEST ( StringUtils  ,
format_string_computed_lens   
)

◆ TEST() [11/36]

TEST ( StringUtils  ,
format_string_csv   
)

◆ TEST() [12/36]

TEST ( StringUtils  ,
format_string_no_underflow   
)

◆ TEST() [13/36]

TEST ( StringUtils  ,
join_dynlist   
)

Definition at line 150 of file ah-string-utils.cc.

References Aleph::DynList< T >::append(), Aleph::join(), l, and Aleph::maps().

◆ TEST() [14/36]

TEST ( StringUtils  ,
justify_and_align_except_first   
)

◆ TEST() [15/36]

TEST ( StringUtils  ,
numeric_boundaries   
)

Definition at line 433 of file ah-string-utils.cc.

References Aleph::is_long(), Aleph::is_size_t(), and Aleph::maps().

◆ TEST() [16/36]

TEST ( StringUtils  ,
numeric_parsers   
)

◆ TEST() [17/36]

TEST ( StringUtils  ,
only_alpha_and_removals   
)

◆ TEST() [18/36]

TEST ( StringUtils  ,
pascal_case   
)

Definition at line 255 of file ah-string-utils.cc.

References Aleph::maps(), and Aleph::to_Pascalcase().

◆ TEST() [19/36]

TEST ( StringUtils  ,
prefix_and_remove_prefix   
)

Definition at line 187 of file ah-string-utils.cc.

References Aleph::is_prefix(), Aleph::maps(), and Aleph::remove_prefix().

◆ TEST() [20/36]

TEST ( StringUtils  ,
split_and_split_string   
)

◆ TEST() [21/36]

TEST ( StringUtils  ,
split_camel_case   
)

◆ TEST() [22/36]

TEST ( StringUtils  ,
split_n   
)

◆ TEST() [23/36]

TEST ( StringUtils  ,
split_pos   
)

Definition at line 261 of file ah-string-utils.cc.

References Aleph::maps(), and Aleph::split_pos().

◆ TEST() [24/36]

TEST ( StringUtils  ,
split_text_into_words_and_lines   
)

◆ TEST() [25/36]

TEST ( StringUtils  ,
split_to_array   
)

Definition at line 366 of file ah-string-utils.cc.

References Aleph::maps(), and Aleph::split_to_array().

◆ TEST() [26/36]

TEST ( StringUtils  ,
text_wrapping_and_shift   
)

◆ TEST() [27/36]

TEST ( StringUtils  ,
to_name   
)

Definition at line 197 of file ah-string-utils.cc.

References Aleph::maps(), and Aleph::to_name().

◆ TEST() [28/36]

TEST ( StringUtils  ,
to_string_matrix_and_lines   
)

◆ TEST() [29/36]

TEST ( StringUtils  ,
trim_variants   
)

Definition at line 84 of file ah-string-utils.cc.

References Aleph::maps(), Aleph::trim(), and Aleph::trim_in_place().

◆ TEST() [30/36]

TEST ( StringUtils  ,
vector_to_string   
)

Definition at line 65 of file ah-string-utils.cc.

References Aleph::maps(), and Aleph::to_string().

◆ TEST() [31/36]

TEST ( StringUtilsStress  ,
build_pars_list_round_trip_for_ints   
)

Definition at line 561 of file ah-string-utils.cc.

References Aleph::build_pars_list(), Aleph::maps(), rng, and stress_multiplier().

◆ TEST() [32/36]

TEST ( StringUtilsStress  ,
case_conversion_no_crash_and_preserves_length   
)

◆ TEST() [33/36]

◆ TEST() [34/36]

TEST ( StringUtilsStress  ,
split_pos_recomposes   
)

◆ TEST() [35/36]

TEST ( StringUtilsStress  ,
split_string_tokens_have_no_delims   
)

◆ TEST() [36/36]

TEST ( util  ,
concat   
)

Definition at line 55 of file ah-string-utils.cc.

References Aleph::concat(), and Aleph::maps().