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

Tests for Ah Zip Utils. More...

#include <gtest/gtest.h>
#include <ah-zip-utils.H>
#include <htlist.H>
#include <tpl_dynArray.H>
#include <tpl_dynDlist.H>
#include <tpl_dynSetTree.H>
#include <tpl_dynSetHash.H>
#include <tpl_arrayStack.H>
#include <tpl_dynListStack.H>
#include <tpl_arrayQueue.H>
#include <tpl_dynListQueue.H>
#include <vector>
#include <list>
#include <deque>
#include <set>
#include <unordered_set>
#include <array>
#include <string>
#include <forward_list>
Include dependency graph for ah-zip-utils_test.cc:

Go to the source code of this file.

Classes

struct  StatefulCounter
 
struct  StatefulAccumulator
 

Functions

 TEST (UniZipStlOnly, TwoVectors)
 
 TEST (UniZipStlOnly, VectorAndList)
 
 TEST (UniZipStlOnly, ThreeContainers)
 
 TEST (UniZipAlephOnly, TwoDynLists)
 
 TEST (UniZipAlephOnly, DynListAndDynArray)
 
 TEST (UniZipMixed, VectorAndDynList)
 
 TEST (UniZipMixed, DynListAndVector)
 
 TEST (UniZipMixed, ThreeMixedContainers)
 
 TEST (UniZipMixed, DifferentLengths)
 
 TEST (UniZipMixedOps, All)
 
 TEST (UniZipMixedOps, Exists)
 
 TEST (UniZipMixedOps, ForEach)
 
 TEST (UniZipMixedOps, Foldl)
 
 TEST (UniZipMixedOps, Map)
 
 TEST (UniZipMixedOps, Filter)
 
 TEST (UniZipMixedOps, FindFirst)
 
 TEST (UniZipMixedOps, Count)
 
 TEST (UniZipMixedOps, Nth)
 
 TEST (UniZipMixedOps, Take)
 
 TEST (UniZipMixedOps, Drop)
 
 TEST (UniZipMixedOps, TakeWhile)
 
 TEST (UniZipMixedOps, DropWhile)
 
 TEST (UniZipMixedOps, FirstLast)
 
 TEST (UniZipMixedOps, Partition)
 
 TEST (UniZipMixedOps, ToVector)
 
 TEST (UniZipMixedOps, EqualLength)
 
 TEST (UniZipEdgeCases, EmptyContainers)
 
 TEST (UniZipEdgeCases, OneEmptyMixed)
 
 TEST (UniZipEdgeCases, SingleElement)
 
template<typename T >
void populate_dynlist (DynList< T > &l, std::initializer_list< T > values)
 
template<typename T >
void populate_dyndlist (DynDlist< T > &l, std::initializer_list< T > values)
 
template<typename T >
void populate_dynarray (DynArray< T > &arr, std::initializer_list< T > values)
 
 TEST (ExhaustiveMix, VectorWithDynList)
 
 TEST (ExhaustiveMix, VectorWithDynDlist)
 
 TEST (ExhaustiveMix, VectorWithDynArray)
 
 TEST (ExhaustiveMix, VectorWithDynSetTree)
 
 TEST (ExhaustiveMix, ListWithDynList)
 
 TEST (ExhaustiveMix, ListWithDynArray)
 
 TEST (ExhaustiveMix, DequeWithDynList)
 
 TEST (ExhaustiveMix, DequeWithDynDlist)
 
 TEST (ExhaustiveMix, SetWithDynList)
 
 TEST (ExhaustiveMix, SetWithDynArray)
 
 TEST (ExhaustiveMix, StdArrayWithDynList)
 
 TEST (ExhaustiveMix, StdArrayWithDynDlist)
 
 TEST (ExhaustiveMix, ThreeWayMix_VectorDynListDeque)
 
 TEST (ExhaustiveMix, ThreeWayMix_DynListVectorDynArray)
 
 TEST (ExhaustiveMix, FourWayMix)
 
 TEST (ExhaustiveMix, DynListWithDynDlist)
 
 TEST (ExhaustiveMix, DynArrayWithDynSetTree)
 
 TEST (ExhaustiveMix, ThreeAlephContainers)
 
 TEST (ExhaustiveMix, DifferentLengths_StlLonger)
 
 TEST (ExhaustiveMix, DifferentLengths_AlephLonger)
 
 TEST (ExhaustiveMix, DifferentLengths_ThreeWay)
 
 TEST (ExhaustiveMix, FilterMixed)
 
 TEST (ExhaustiveMix, PartitionMixed)
 
 TEST (ExhaustiveMix, TakeDropMixed)
 
 TEST (ExhaustiveMix, TakeWhileDropWhileMixed)
 
 TEST (ExhaustiveMix, StringWithDynList)
 
 TEST (UniZipMlOps, Mapi)
 
 TEST (UniZipMlOps, Filteri)
 
 TEST (UniZipMlOps, ScanLeft)
 
 TEST (UniZipMlOps, FindMapi)
 
 TEST (UniZipMlOps, EqualBy)
 
 TEST (UniZipMlOps, Mem)
 
 TEST (UniZipMlOps, Assoc)
 
 TEST (UniZipMlOps, Min)
 
 TEST (UniZipMlOps, Max)
 
 TEST (UniZipMlOps, MinMax)
 
 TEST (UniUnzip, StlVectorOfPairs)
 
 TEST (UniUnzip, AlephDynListOfPairs)
 
 TEST (UniUnzipTuple, StlVectorOfTuples)
 
 TEST (UniUnzipTuple, AlephDynListOfTuples)
 
 TEST (UniZipToDynlist, Basic)
 
 TEST (UniZipStatefulCallable, ForEachPreservesState)
 
 TEST (UniZipStatefulCallable, AllPreservesState)
 
 TEST (UniZipStatefulCallable, MapPreservesState)
 
 TEST (UniZipStatefulCallable, FilterPreservesState)
 
 TEST (UniZipStatefulCallable, FoldlPreservesState)
 
 TEST (UniZipEqualLength, AllCompletedCheck)
 
 TEST (UniZipEqualLength, AllEqSemanticsCorrect)
 
 TEST (UniZipEqualLength, EqualByWithLengthCheck)
 
 TEST (UniZipSentinel, EndIsO1)
 
 TEST (UniZipSentinel, IteratorSentinelComparison)
 
 TEST (UniZipIteratorAPI, AnyHasCurrVsHasCurr)
 
 TEST (UniZipIteratorAPI, AllCompletedVsCompleted)
 
 TEST (UniZipEdgeCases, EmptyContainersWithCallables)
 
 TEST (UniZipEdgeCases, SingleElementWithStatefulCallable)
 
int main (int argc, char **argv)
 

Detailed Description

Tests for Ah Zip Utils.

Definition in file ah-zip-utils_test.cc.

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 1389 of file ah-zip-utils_test.cc.

◆ populate_dynarray()

template<typename T >
void populate_dynarray ( DynArray< T > &  arr,
std::initializer_list< T >  values 
)

Definition at line 486 of file ah-zip-utils_test.cc.

References Aleph::DynArray< T >::append().

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

◆ populate_dyndlist()

template<typename T >
void populate_dyndlist ( DynDlist< T > &  l,
std::initializer_list< T >  values 
)

Definition at line 479 of file ah-zip-utils_test.cc.

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

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

◆ populate_dynlist()

template<typename T >
void populate_dynlist ( DynList< T > &  l,
std::initializer_list< T >  values 
)

Definition at line 472 of file ah-zip-utils_test.cc.

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

◆ TEST() [1/84]

TEST ( ExhaustiveMix  ,
DequeWithDynDlist   
)

Definition at line 607 of file ah-zip-utils_test.cc.

References populate_dyndlist(), and Aleph::uni_zip_map().

◆ TEST() [2/84]

TEST ( ExhaustiveMix  ,
DequeWithDynList   
)

Definition at line 595 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_all().

◆ TEST() [3/84]

TEST ( ExhaustiveMix  ,
DifferentLengths_AlephLonger   
)

Definition at line 804 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_length().

◆ TEST() [4/84]

TEST ( ExhaustiveMix  ,
DifferentLengths_StlLonger   
)

Definition at line 796 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_length().

◆ TEST() [5/84]

TEST ( ExhaustiveMix  ,
DifferentLengths_ThreeWay   
)

Definition at line 812 of file ah-zip-utils_test.cc.

References l, and Aleph::uni_zip_length().

◆ TEST() [6/84]

TEST ( ExhaustiveMix  ,
DynArrayWithDynSetTree   
)

◆ TEST() [7/84]

TEST ( ExhaustiveMix  ,
DynListWithDynDlist   
)

Definition at line 742 of file ah-zip-utils_test.cc.

References l1, l2, populate_dyndlist(), and Aleph::uni_zip_map().

◆ TEST() [8/84]

TEST ( ExhaustiveMix  ,
FilterMixed   
)

Definition at line 825 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_filter().

◆ TEST() [9/84]

TEST ( ExhaustiveMix  ,
FourWayMix   
)

Definition at line 722 of file ah-zip-utils_test.cc.

References l, populate_dynarray(), and Aleph::uni_zip_map().

◆ TEST() [10/84]

TEST ( ExhaustiveMix  ,
ListWithDynArray   
)

◆ TEST() [11/84]

TEST ( ExhaustiveMix  ,
ListWithDynList   
)

Definition at line 559 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_map().

◆ TEST() [12/84]

TEST ( ExhaustiveMix  ,
PartitionMixed   
)

◆ TEST() [13/84]

TEST ( ExhaustiveMix  ,
SetWithDynArray   
)

Definition at line 644 of file ah-zip-utils_test.cc.

References populate_dynarray(), and Aleph::uni_zip_map().

◆ TEST() [14/84]

TEST ( ExhaustiveMix  ,
SetWithDynList   
)

Definition at line 625 of file ah-zip-utils_test.cc.

References Aleph::uni_zip().

◆ TEST() [15/84]

TEST ( ExhaustiveMix  ,
StdArrayWithDynDlist   
)

Definition at line 673 of file ah-zip-utils_test.cc.

References populate_dyndlist(), and Aleph::uni_zip_map().

◆ TEST() [16/84]

TEST ( ExhaustiveMix  ,
StdArrayWithDynList   
)

Definition at line 661 of file ah-zip-utils_test.cc.

References Aleph::sum(), and Aleph::uni_zip_foldl().

◆ TEST() [17/84]

TEST ( ExhaustiveMix  ,
StringWithDynList   
)

Definition at line 895 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_map().

◆ TEST() [18/84]

TEST ( ExhaustiveMix  ,
TakeDropMixed   
)

Definition at line 858 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_drop(), and Aleph::uni_zip_take().

◆ TEST() [19/84]

TEST ( ExhaustiveMix  ,
TakeWhileDropWhileMixed   
)

◆ TEST() [20/84]

TEST ( ExhaustiveMix  ,
ThreeAlephContainers   
)

◆ TEST() [21/84]

TEST ( ExhaustiveMix  ,
ThreeWayMix_DynListVectorDynArray   
)

Definition at line 706 of file ah-zip-utils_test.cc.

References Aleph::count(), l, populate_dynarray(), and Aleph::uni_zip().

◆ TEST() [22/84]

TEST ( ExhaustiveMix  ,
ThreeWayMix_VectorDynListDeque   
)

Definition at line 691 of file ah-zip-utils_test.cc.

References l, and Aleph::uni_zip_map().

◆ TEST() [23/84]

TEST ( ExhaustiveMix  ,
VectorWithDynArray   
)

Definition at line 524 of file ah-zip-utils_test.cc.

References populate_dynarray(), and Aleph::uni_zip_map().

◆ TEST() [24/84]

TEST ( ExhaustiveMix  ,
VectorWithDynDlist   
)

Definition at line 510 of file ah-zip-utils_test.cc.

References populate_dyndlist(), Aleph::sum(), and Aleph::uni_zip_foldl().

◆ TEST() [25/84]

TEST ( ExhaustiveMix  ,
VectorWithDynList   
)

Definition at line 496 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_map().

◆ TEST() [26/84]

TEST ( ExhaustiveMix  ,
VectorWithDynSetTree   
)

◆ TEST() [27/84]

TEST ( UniUnzip  ,
AlephDynListOfPairs   
)

Definition at line 1064 of file ah-zip-utils_test.cc.

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

◆ TEST() [28/84]

TEST ( UniUnzip  ,
StlVectorOfPairs   
)

Definition at line 1044 of file ah-zip-utils_test.cc.

References Aleph::uni_unzip().

◆ TEST() [29/84]

TEST ( UniUnzipTuple  ,
AlephDynListOfTuples   
)

◆ TEST() [30/84]

TEST ( UniUnzipTuple  ,
StlVectorOfTuples   
)

Definition at line 1077 of file ah-zip-utils_test.cc.

References Aleph::uni_unzip_tuple().

◆ TEST() [31/84]

TEST ( UniZipAlephOnly  ,
DynListAndDynArray   
)

◆ TEST() [32/84]

TEST ( UniZipAlephOnly  ,
TwoDynLists   
)

Definition at line 129 of file ah-zip-utils_test.cc.

References l1, l2, and Aleph::uni_zip().

◆ TEST() [33/84]

TEST ( UniZipEdgeCases  ,
EmptyContainers   
)

Definition at line 436 of file ah-zip-utils_test.cc.

References Aleph::uni_zip().

◆ TEST() [34/84]

TEST ( UniZipEdgeCases  ,
EmptyContainersWithCallables   
)

Definition at line 1354 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_for_each(), and Aleph::uni_zip_map().

◆ TEST() [35/84]

TEST ( UniZipEdgeCases  ,
OneEmptyMixed   
)

Definition at line 446 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_length().

◆ TEST() [36/84]

TEST ( UniZipEdgeCases  ,
SingleElement   
)

Definition at line 454 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_first().

◆ TEST() [37/84]

TEST ( UniZipEdgeCases  ,
SingleElementWithStatefulCallable   
)

Definition at line 1372 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_map().

◆ TEST() [38/84]

TEST ( UniZipEqualLength  ,
AllCompletedCheck   
)

Definition at line 1213 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_equal_length().

◆ TEST() [39/84]

TEST ( UniZipEqualLength  ,
AllEqSemanticsCorrect   
)

Definition at line 1227 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_all_eq().

◆ TEST() [40/84]

TEST ( UniZipEqualLength  ,
EqualByWithLengthCheck   
)

Definition at line 1245 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_equal_by().

◆ TEST() [41/84]

TEST ( UniZipIteratorAPI  ,
AllCompletedVsCompleted   
)

Definition at line 1334 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_it().

◆ TEST() [42/84]

TEST ( UniZipIteratorAPI  ,
AnyHasCurrVsHasCurr   
)

Definition at line 1312 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_it().

◆ TEST() [43/84]

TEST ( UniZipMixed  ,
DifferentLengths   
)

Definition at line 210 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_length().

◆ TEST() [44/84]

TEST ( UniZipMixed  ,
DynListAndVector   
)

Definition at line 181 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_map().

◆ TEST() [45/84]

TEST ( UniZipMixed  ,
ThreeMixedContainers   
)

Definition at line 195 of file ah-zip-utils_test.cc.

References Aleph::count(), and Aleph::uni_zip().

◆ TEST() [46/84]

TEST ( UniZipMixed  ,
VectorAndDynList   
)

Definition at line 167 of file ah-zip-utils_test.cc.

References Aleph::uni_zip().

◆ TEST() [47/84]

TEST ( UniZipMixedOps  ,
All   
)

Definition at line 222 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_all().

◆ TEST() [48/84]

TEST ( UniZipMixedOps  ,
Count   
)

Definition at line 312 of file ah-zip-utils_test.cc.

References Aleph::count(), and Aleph::uni_zip_count().

◆ TEST() [49/84]

TEST ( UniZipMixedOps  ,
Drop   
)

Definition at line 347 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_drop().

◆ TEST() [50/84]

TEST ( UniZipMixedOps  ,
DropWhile   
)

Definition at line 370 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_drop_while().

◆ TEST() [51/84]

TEST ( UniZipMixedOps  ,
EqualLength   
)

Definition at line 422 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_equal_length().

◆ TEST() [52/84]

TEST ( UniZipMixedOps  ,
Exists   
)

Definition at line 234 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_exists().

◆ TEST() [53/84]

TEST ( UniZipMixedOps  ,
Filter   
)

Definition at line 286 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_filter().

◆ TEST() [54/84]

TEST ( UniZipMixedOps  ,
FindFirst   
)

Definition at line 298 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_find_first().

◆ TEST() [55/84]

TEST ( UniZipMixedOps  ,
FirstLast   
)

Definition at line 383 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_first(), and Aleph::uni_zip_last().

◆ TEST() [56/84]

TEST ( UniZipMixedOps  ,
Foldl   
)

Definition at line 261 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_foldl().

◆ TEST() [57/84]

TEST ( UniZipMixedOps  ,
ForEach   
)

Definition at line 246 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_for_each().

◆ TEST() [58/84]

TEST ( UniZipMixedOps  ,
Map   
)

Definition at line 273 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_map().

◆ TEST() [59/84]

TEST ( UniZipMixedOps  ,
Nth   
)

Definition at line 324 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_nth().

◆ TEST() [60/84]

TEST ( UniZipMixedOps  ,
Partition   
)

Definition at line 399 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_partition().

◆ TEST() [61/84]

TEST ( UniZipMixedOps  ,
Take   
)

Definition at line 336 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_take().

◆ TEST() [62/84]

TEST ( UniZipMixedOps  ,
TakeWhile   
)

Definition at line 358 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_take_while().

◆ TEST() [63/84]

TEST ( UniZipMixedOps  ,
ToVector   
)

Definition at line 412 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_to_vector().

◆ TEST() [64/84]

TEST ( UniZipMlOps  ,
Assoc   
)

Definition at line 994 of file ah-zip-utils_test.cc.

References keys, and Aleph::uni_zip_assoc().

◆ TEST() [65/84]

TEST ( UniZipMlOps  ,
EqualBy   
)

Definition at line 973 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_equal_by().

◆ TEST() [66/84]

TEST ( UniZipMlOps  ,
Filteri   
)

Definition at line 927 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_filteri().

◆ TEST() [67/84]

TEST ( UniZipMlOps  ,
FindMapi   
)

Definition at line 958 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_find_mapi().

◆ TEST() [68/84]

TEST ( UniZipMlOps  ,
Mapi   
)

Definition at line 913 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_mapi().

◆ TEST() [69/84]

TEST ( UniZipMlOps  ,
Max   
)

Definition at line 1017 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_max().

◆ TEST() [70/84]

TEST ( UniZipMlOps  ,
Mem   
)

Definition at line 985 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_mem().

◆ TEST() [71/84]

TEST ( UniZipMlOps  ,
Min   
)

Definition at line 1006 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_min().

◆ TEST() [72/84]

TEST ( UniZipMlOps  ,
MinMax   
)

Definition at line 1028 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_min_max().

◆ TEST() [73/84]

TEST ( UniZipMlOps  ,
ScanLeft   
)

Definition at line 941 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_scan_left().

◆ TEST() [74/84]

TEST ( UniZipSentinel  ,
EndIsO1   
)

Definition at line 1266 of file ah-zip-utils_test.cc.

References Aleph::count(), and Aleph::uni_zip().

◆ TEST() [75/84]

TEST ( UniZipSentinel  ,
IteratorSentinelComparison   
)

Definition at line 1287 of file ah-zip-utils_test.cc.

References Aleph::uni_zip().

◆ TEST() [76/84]

TEST ( UniZipStatefulCallable  ,
AllPreservesState   
)

Definition at line 1153 of file ah-zip-utils_test.cc.

References counter, and Aleph::uni_zip_all().

◆ TEST() [77/84]

TEST ( UniZipStatefulCallable  ,
FilterPreservesState   
)

Definition at line 1179 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_filter().

◆ TEST() [78/84]

TEST ( UniZipStatefulCallable  ,
FoldlPreservesState   
)

Definition at line 1194 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_foldl().

◆ TEST() [79/84]

TEST ( UniZipStatefulCallable  ,
ForEachPreservesState   
)

Definition at line 1142 of file ah-zip-utils_test.cc.

References StatefulAccumulator::sum, and Aleph::uni_zip_for_each().

◆ TEST() [80/84]

TEST ( UniZipStatefulCallable  ,
MapPreservesState   
)

Definition at line 1164 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_map().

◆ TEST() [81/84]

TEST ( UniZipStlOnly  ,
ThreeContainers   
)

Definition at line 105 of file ah-zip-utils_test.cc.

References Aleph::count(), and Aleph::uni_zip().

◆ TEST() [82/84]

TEST ( UniZipStlOnly  ,
TwoVectors   
)

Definition at line 77 of file ah-zip-utils_test.cc.

References Aleph::count(), and Aleph::uni_zip().

◆ TEST() [83/84]

TEST ( UniZipStlOnly  ,
VectorAndList   
)

Definition at line 92 of file ah-zip-utils_test.cc.

References l, and Aleph::uni_zip_map().

◆ TEST() [84/84]

TEST ( UniZipToDynlist  ,
Basic   
)

Definition at line 1111 of file ah-zip-utils_test.cc.

References Aleph::uni_zip_to_dynlist().