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

Tests for Ah Functional. More...

#include <gtest/gtest.h>
#include <ah-zip.H>
#include <ahFunctional.H>
#include <ah-string-utils.H>
#include <tpl_dynSetTree.H>
#include <tpl_odhash.H>
#include <tpl_dynArray.H>
Include dependency graph for ah-functional.cc:

Go to the source code of this file.

Classes

struct  TreeContainer
 
struct  Person
 

Functions

 TEST (range, range_combs)
 
 TEST (rep, rep)
 
 TEST (set_range, set_range_with_op)
 
 TEST (each, each_variations)
 
 TEST_F (TreeContainer, pointers)
 
 TEST_F (TreeContainer, sublist)
 
 TEST_F (TreeContainer, ml)
 
 TEST_F (TreeContainer, gen_seq_list_tuples)
 
 TEST_F (TreeContainer, enumerate)
 
 TEST_F (TreeContainer, indexes_and_tindexes)
 
 TEST_F (TreeContainer, reverse_test)
 
 TEST_F (TreeContainer, partition_test)
 
 TEST_F (TreeContainer, diff_test)
 
 TEST_F (TreeContainer, containers_eq_test)
 
 TEST (Compare, comparisons)
 
 TEST_F (TreeContainer, zips)
 
 TEST (sequential_groups_test, sequential_groups)
 
 TEST (unique_sequential_test, unique_sequential)
 
 TEST (pair_iterator_test, pair_iterator)
 
 TEST (container_ops, insert_append_remove)
 
 TEST (assign_container_test, assign_container)
 
 TEST (flatten_test, flatten)
 
 TEST (is_inside_test, is_inside)
 
 TEST (is_equal_test, is_equal)
 
 TEST (FoundItem, FoundItemTests)
 
 TEST (range, range_precision)
 
 TEST (flatten_test, flatten_deep)
 
 TEST (each_test, each_edge)
 
 TEST (none_test, none_basic)
 
 TEST (find_ptr_test, find_ptr_basic)
 
 TEST (foldr_test, foldr_basic)
 
 TEST (sum_product_test, sum_product_basic)
 
 TEST (concat_test, concat_basic)
 
 TEST (take_while_test, take_while_basic)
 
 TEST (drop_while_test, drop_while_basic)
 
 TEST (flat_map_test, flat_map_basic)
 
 TEST (scanl_test, scanl_basic)
 
 TEST (min_max_test, min_max_basic)
 
 TEST (count_if_test, count_if_basic)
 
 TEST (contains_test, contains_basic)
 
 TEST (enumerate_tuple_test, enumerate_tuple_basic)
 
 TEST (zip_longest_test, basic_different_lengths)
 
 TEST (zip_longest_test, second_longer)
 
 TEST (zip_longest_test, equal_lengths)
 
 TEST (zip_longest_test, empty_containers)
 
 TEST (tzip_longest_test, basic_different_lengths)
 
 TEST (zip_longest_opt_test, basic_different_lengths)
 
 TEST (group_by_test, basic_grouping)
 
 TEST (group_by_test, group_by_parity)
 
 TEST (group_by_test, empty_container)
 
 TEST (group_by_test, single_element)
 
 TEST (group_by_reduce_test, sum_groups)
 
 TEST (maps_test, basic_map)
 
 TEST (maps_test, type_conversion)
 
 TEST (filter_map_test, conditional_map)
 
 TEST (filter_map_test, no_matches)
 
 TEST (split_test, basic_split)
 
 TEST (take_drop_test, take_basic)
 
 TEST (take_drop_test, drop_basic)
 
 TEST (take_drop_test, take_drop_range)
 
 TEST (to_dynlist_test, from_tree)
 
 TEST (to_dynlist_test, from_array)
 
 TEST (traverse_filter_test, count_evens)
 
 TEST (functional_stress_test, large_container)
 
 TEST (functional_stress_test, chained_operations)
 
 TEST (functional_edge_test, empty_container_operations)
 
 TEST (functional_edge_test, single_element)
 
 TEST (functional_complex_type_test, struct_operations)
 
 TEST (functional_composition_test, nested_maps)
 
 TEST (functional_composition_test, filter_then_map)
 
 TEST (quantifier_test, all_comprehensive)
 
 TEST (quantifier_test, exists_comprehensive)
 
 TEST (quantifier_test, none_comprehensive)
 
 TEST (scanl_comprehensive, scanl_sum_variants)
 
 TEST (scanl_comprehensive, scanl_custom_op)
 
 TEST (flat_map_comprehensive, basic_operations)
 
 TEST (flat_map_comprehensive, replicate_pattern)
 
 TEST (flat_map_comprehensive, empty_inner)
 
 TEST (concat_comprehensive, various_combinations)
 
 TEST (while_comprehensive, take_while_various)
 
 TEST (while_comprehensive, drop_while_various)
 
 TEST (reverse_comprehensive, various_sizes)
 
 TEST (min_max_ptr_comprehensive, with_comparator)
 
 TEST (min_max_ptr_comprehensive, minmax_combined)
 
 TEST (fold_comprehensive, foldl_associativity)
 
 TEST (fold_comprehensive, foldr_associativity)
 
 TEST (zip_comprehensive, different_lengths)
 
 TEST (zip_comprehensive, zip_all_predicate)
 
 TEST (group_by_comprehensive, custom_key)
 
 TEST (functional_performance, large_chain)
 
 TEST (functional_performance, deep_nesting)
 

Detailed Description

Tests for Ah Functional.

Definition in file ah-functional.cc.

Function Documentation

◆ TEST() [1/80]

TEST ( assign_container_test  ,
assign_container   
)

Definition at line 357 of file ah-functional.cc.

References Aleph::maps().

◆ TEST() [2/80]

TEST ( Compare  ,
comparisons   
)

◆ TEST() [3/80]

TEST ( concat_comprehensive  ,
various_combinations   
)

Definition at line 1258 of file ah-functional.cc.

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

◆ TEST() [4/80]

TEST ( concat_test  ,
concat_basic   
)

Definition at line 524 of file ah-functional.cc.

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

◆ TEST() [5/80]

◆ TEST() [6/80]

TEST ( contains_test  ,
contains_basic   
)

Definition at line 652 of file ah-functional.cc.

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

◆ TEST() [7/80]

TEST ( count_if_test  ,
count_if_basic   
)

Definition at line 640 of file ah-functional.cc.

References Aleph::count_if(), l, and Aleph::maps().

◆ TEST() [8/80]

TEST ( drop_while_test  ,
drop_while_basic   
)

Definition at line 553 of file ah-functional.cc.

References Aleph::drop_while(), Aleph::HTList::is_empty(), l, and Aleph::maps().

◆ TEST() [9/80]

TEST ( each  ,
each_variations   
)

Definition at line 75 of file ah-functional.cc.

References Aleph::count(), Aleph::each(), and Aleph::maps().

◆ TEST() [10/80]

TEST ( each_test  ,
each_edge   
)

Definition at line 449 of file ah-functional.cc.

References Aleph::count(), Aleph::each(), and Aleph::maps().

◆ TEST() [11/80]

TEST ( enumerate_tuple_test  ,
enumerate_tuple_basic   
)

Definition at line 666 of file ah-functional.cc.

References Aleph::enumerate_tuple(), l, and Aleph::maps().

◆ TEST() [12/80]

TEST ( filter_map_test  ,
conditional_map   
)

Definition at line 902 of file ah-functional.cc.

References Aleph::filter(), l, and Aleph::maps().

◆ TEST() [13/80]

TEST ( filter_map_test  ,
no_matches   
)

Definition at line 913 of file ah-functional.cc.

References Aleph::filter(), l, and Aleph::maps().

◆ TEST() [14/80]

TEST ( find_ptr_test  ,
find_ptr_basic   
)

◆ TEST() [15/80]

TEST ( flat_map_comprehensive  ,
basic_operations   
)

Definition at line 1217 of file ah-functional.cc.

References Aleph::flat_map(), l, Aleph::maps(), and Aleph::range().

◆ TEST() [16/80]

TEST ( flat_map_comprehensive  ,
empty_inner   
)

Definition at line 1243 of file ah-functional.cc.

References Aleph::flat_map(), l, and Aleph::maps().

◆ TEST() [17/80]

TEST ( flat_map_comprehensive  ,
replicate_pattern   
)

Definition at line 1229 of file ah-functional.cc.

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

◆ TEST() [18/80]

TEST ( flat_map_test  ,
flat_map_basic   
)

Definition at line 569 of file ah-functional.cc.

References Aleph::flat_map(), l, Aleph::maps(), and Aleph::range().

◆ TEST() [19/80]

TEST ( flatten_test  ,
flatten   
)

Definition at line 364 of file ah-functional.cc.

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

◆ TEST() [20/80]

TEST ( flatten_test  ,
flatten_deep   
)

◆ TEST() [21/80]

TEST ( fold_comprehensive  ,
foldl_associativity   
)

Definition at line 1366 of file ah-functional.cc.

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

◆ TEST() [22/80]

TEST ( fold_comprehensive  ,
foldr_associativity   
)

Definition at line 1380 of file ah-functional.cc.

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

◆ TEST() [23/80]

TEST ( foldr_test  ,
foldr_basic   
)

Definition at line 494 of file ah-functional.cc.

References l, and Aleph::maps().

◆ TEST() [24/80]

TEST ( FoundItem  ,
FoundItemTests   
)

◆ TEST() [25/80]

TEST ( functional_complex_type_test  ,
struct_operations   
)

◆ TEST() [26/80]

TEST ( functional_composition_test  ,
filter_then_map   
)

Definition at line 1124 of file ah-functional.cc.

References Aleph::filter(), l, Aleph::maps(), Aleph::range(), and Aleph::to_string().

◆ TEST() [27/80]

TEST ( functional_composition_test  ,
nested_maps   
)

Definition at line 1114 of file ah-functional.cc.

References l, and Aleph::maps().

◆ TEST() [28/80]

TEST ( functional_edge_test  ,
empty_container_operations   
)

◆ TEST() [29/80]

TEST ( functional_edge_test  ,
single_element   
)

◆ TEST() [30/80]

TEST ( functional_performance  ,
deep_nesting   
)

Definition at line 1472 of file ah-functional.cc.

References l, Aleph::maps(), and Aleph::range().

◆ TEST() [31/80]

TEST ( functional_performance  ,
large_chain   
)

◆ TEST() [32/80]

TEST ( functional_stress_test  ,
chained_operations   
)

◆ TEST() [33/80]

TEST ( functional_stress_test  ,
large_container   
)

◆ TEST() [34/80]

TEST ( group_by_comprehensive  ,
custom_key   
)

◆ TEST() [35/80]

TEST ( group_by_reduce_test  ,
sum_groups   
)

Definition at line 858 of file ah-functional.cc.

References Aleph::group_by_reduce(), l, Aleph::maps(), and Aleph::sum().

◆ TEST() [36/80]

TEST ( group_by_test  ,
basic_grouping   
)

Definition at line 798 of file ah-functional.cc.

References Aleph::group_by(), l, and Aleph::maps().

◆ TEST() [37/80]

TEST ( group_by_test  ,
empty_container   
)

Definition at line 840 of file ah-functional.cc.

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

◆ TEST() [38/80]

TEST ( group_by_test  ,
group_by_parity   
)

Definition at line 821 of file ah-functional.cc.

References Aleph::group_by(), l, and Aleph::maps().

◆ TEST() [39/80]

TEST ( group_by_test  ,
single_element   
)

Definition at line 847 of file ah-functional.cc.

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

◆ TEST() [40/80]

TEST ( is_equal_test  ,
is_equal   
)

Definition at line 384 of file ah-functional.cc.

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

◆ TEST() [41/80]

TEST ( is_inside_test  ,
is_inside   
)

Definition at line 375 of file ah-functional.cc.

References Aleph::is_inside(), l, and Aleph::maps().

◆ TEST() [42/80]

TEST ( maps_test  ,
basic_map   
)

Definition at line 886 of file ah-functional.cc.

References l, and Aleph::maps().

◆ TEST() [43/80]

TEST ( maps_test  ,
type_conversion   
)

Definition at line 894 of file ah-functional.cc.

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

◆ TEST() [44/80]

TEST ( min_max_ptr_comprehensive  ,
minmax_combined   
)

Definition at line 1353 of file ah-functional.cc.

References l, Aleph::maps(), and Aleph::minmax_ptr().

◆ TEST() [45/80]

TEST ( min_max_ptr_comprehensive  ,
with_comparator   
)

◆ TEST() [46/80]

TEST ( min_max_test  ,
min_max_basic   
)

Definition at line 601 of file ah-functional.cc.

References l, Aleph::maps(), Aleph::max_ptr(), Aleph::min_ptr(), and Aleph::minmax_ptr().

◆ TEST() [47/80]

TEST ( none_test  ,
none_basic   
)

Definition at line 462 of file ah-functional.cc.

References l, Aleph::maps(), and Aleph::none().

◆ TEST() [48/80]

TEST ( pair_iterator_test  ,
pair_iterator   
)

Definition at line 315 of file ah-functional.cc.

References Aleph::get_pair_it(), Aleph::maps(), and Aleph::range().

◆ TEST() [49/80]

TEST ( quantifier_test  ,
all_comprehensive   
)

Definition at line 1138 of file ah-functional.cc.

References Aleph::all(), l, and Aleph::maps().

◆ TEST() [50/80]

TEST ( quantifier_test  ,
exists_comprehensive   
)

Definition at line 1151 of file ah-functional.cc.

References Aleph::exists(), l, and Aleph::maps().

◆ TEST() [51/80]

TEST ( quantifier_test  ,
none_comprehensive   
)

Definition at line 1164 of file ah-functional.cc.

References l, Aleph::maps(), and Aleph::none().

◆ TEST() [52/80]

TEST ( range  ,
range_combs   
)

◆ TEST() [53/80]

TEST ( range  ,
range_precision   
)

◆ TEST() [54/80]

TEST ( rep  ,
rep   
)

Definition at line 59 of file ah-functional.cc.

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

◆ TEST() [55/80]

TEST ( reverse_comprehensive  ,
various_sizes   
)

Definition at line 1316 of file ah-functional.cc.

References l, Aleph::maps(), Aleph::range(), and Aleph::reverse().

◆ TEST() [56/80]

TEST ( scanl_comprehensive  ,
scanl_custom_op   
)

Definition at line 1202 of file ah-functional.cc.

References l, and Aleph::maps().

◆ TEST() [57/80]

TEST ( scanl_comprehensive  ,
scanl_sum_variants   
)

◆ TEST() [58/80]

TEST ( scanl_test  ,
scanl_basic   
)

Definition at line 586 of file ah-functional.cc.

References l, Aleph::maps(), and Aleph::scanl_sum().

◆ TEST() [59/80]

TEST ( sequential_groups_test  ,
sequential_groups   
)

◆ TEST() [60/80]

TEST ( set_range  ,
set_range_with_op   
)

Definition at line 65 of file ah-functional.cc.

References Aleph::maps().

◆ TEST() [61/80]

TEST ( split_test  ,
basic_split   
)

◆ TEST() [62/80]

TEST ( sum_product_test  ,
sum_product_basic   
)

Definition at line 507 of file ah-functional.cc.

References l, Aleph::maps(), Aleph::product(), and Aleph::sum().

◆ TEST() [63/80]

TEST ( take_drop_test  ,
drop_basic   
)

Definition at line 948 of file ah-functional.cc.

References FunctionalMethods< Container, T >::drop(), l, and Aleph::maps().

◆ TEST() [64/80]

TEST ( take_drop_test  ,
take_basic   
)

Definition at line 939 of file ah-functional.cc.

References l, Aleph::maps(), and FunctionalMethods< Container, T >::take().

◆ TEST() [65/80]

TEST ( take_drop_test  ,
take_drop_range   
)

Definition at line 957 of file ah-functional.cc.

References l, Aleph::maps(), and FunctionalMethods< Container, T >::take().

◆ TEST() [66/80]

TEST ( take_while_test  ,
take_while_basic   
)

◆ TEST() [67/80]

TEST ( to_dynlist_test  ,
from_array   
)

◆ TEST() [68/80]

TEST ( to_dynlist_test  ,
from_tree   
)

◆ TEST() [69/80]

TEST ( traverse_filter_test  ,
count_evens   
)

◆ TEST() [70/80]

TEST ( tzip_longest_test  ,
basic_different_lengths   
)

Definition at line 753 of file ah-functional.cc.

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

◆ TEST() [71/80]

TEST ( unique_sequential_test  ,
unique_sequential   
)

◆ TEST() [72/80]

TEST ( while_comprehensive  ,
drop_while_various   
)

◆ TEST() [73/80]

TEST ( while_comprehensive  ,
take_while_various   
)

◆ TEST() [74/80]

TEST ( zip_comprehensive  ,
different_lengths   
)

◆ TEST() [75/80]

TEST ( zip_comprehensive  ,
zip_all_predicate   
)

Definition at line 1408 of file ah-functional.cc.

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

◆ TEST() [76/80]

TEST ( zip_longest_opt_test  ,
basic_different_lengths   
)

Definition at line 774 of file ah-functional.cc.

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

◆ TEST() [77/80]

TEST ( zip_longest_test  ,
basic_different_lengths   
)

Definition at line 690 of file ah-functional.cc.

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

◆ TEST() [78/80]

TEST ( zip_longest_test  ,
empty_containers   
)

◆ TEST() [79/80]

TEST ( zip_longest_test  ,
equal_lengths   
)

Definition at line 721 of file ah-functional.cc.

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

◆ TEST() [80/80]

TEST ( zip_longest_test  ,
second_longer   
)

Definition at line 706 of file ah-functional.cc.

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

◆ TEST_F() [1/11]

TEST_F ( TreeContainer  ,
containers_eq_test   
)

Definition at line 204 of file ah-functional.cc.

References Aleph::containers_eq(), l, Aleph::maps(), N, and tbl.

◆ TEST_F() [2/11]

TEST_F ( TreeContainer  ,
diff_test   
)

Definition at line 194 of file ah-functional.cc.

References Aleph::diff(), Aleph::DynList< T >::get_last(), Aleph::maps(), and N.

◆ TEST_F() [3/11]

TEST_F ( TreeContainer  ,
enumerate   
)

◆ TEST_F() [4/11]

TEST_F ( TreeContainer  ,
gen_seq_list_tuples   
)

◆ TEST_F() [5/11]

TEST_F ( TreeContainer  ,
indexes_and_tindexes   
)

◆ TEST_F() [6/11]

◆ TEST_F() [7/11]

TEST_F ( TreeContainer  ,
partition_test   
)

Definition at line 187 of file ah-functional.cc.

References Aleph::maps(), Aleph::partition(), and tbl.

◆ TEST_F() [8/11]

TEST_F ( TreeContainer  ,
pointers   
)

◆ TEST_F() [9/11]

TEST_F ( TreeContainer  ,
reverse_test   
)

Definition at line 180 of file ah-functional.cc.

References l, Aleph::maps(), N, and Aleph::reverse().

◆ TEST_F() [10/11]

TEST_F ( TreeContainer  ,
sublist   
)

Definition at line 107 of file ah-functional.cc.

References Aleph::maps(), Aleph::sublist(), and tbl.

◆ TEST_F() [11/11]