{-# OPTIONS_GHC -fglasgow-exts -XNoMonomorphismRestriction #-}moduleTest.GMapwhereimportTest.QuickCheckimportTest.QuickCheck.Batch(bottom,isBottom)importTest.GMap.UtilsimportData.GMapasGimportData.GMap.AssocListimportData.GMap.ListMapimportData.GMap.UnitMapimportData.GMap.MaybeMapimportData.GMap.EitherMapimportData.GMap.OrdMapimportData.GMap.IntMap-- import Data.GMap.SerialMapimportData.GMap.CacheKeysimportData.GMap.TupleMapimportData.GMap.EnumMapimportData.GMap.ChoiceMap-- import Data.GMap.BitMapimportData.GMap.InjectKeys-- import Data.Serial-- import Data.Serial.Buildable.WordList()importqualifiedData.ListasLimportPreludehiding(map,lookup)importControl.Monad(liftM)importData.MaybeimportData.OrdimportqualifiedData.ListasLimportSystem.IOimportSystem.EnvironmentimportGHC.Basehiding(map)mapSortKeys::OrderedMapmapk=>mapa->[k]->[k]mapSortKeysmp=L.sortBy(compareKeymp)mapSortAssocs::OrderedMapmapk=>mapa->[(k,a)]->[(k,a)]mapSortAssocsmp=L.sortBy(\(k1,_)(k2,_)->compareKeympk1k2)-- ### Testing OrderedMap methods ###prop_lookup_emptympk=Nothing==(lookupk$empty`like`mp)prop_lookup_singletonmp(k,a)=Justa==(lookupk$singletonka`like`mp)-- General test patterndoWithkampf=lookupk$f$insertkamp-- Another useful patterndoWithoutkmpf=lookupk$f$deletekmpprop_insert_withmp(k,a)=Justa==(doWithkamp$insertka)prop_insert_withoutmp(k,a)=Justa==(doWithoutkmp$insertka)prop_insertWith_withmp(k,a1,a2,f)=Just(fa1)==(doWithka1mp$insertWithfka2)prop_insertWith_withoutmp(k,a2,f)=Justa2==(doWithoutkmp$insertWithfka2)prop_insertWith'_withmp(k,a1,a2,f)=Just(fa1)==(doWithka1mp$insertWith'fka2)prop_insertWith'_withoutmp(k,a2,f)=Justa2==(doWithoutkmp$insertWith'fka2)prop_insertMaybe_withmp(k,a1,a2,f)=(f=<<Justa1)==(doWithka1mp$insertMaybefka2)prop_insertMaybe_withoutmp(k,a2,f)=Justa2==(doWithoutkmp$insertMaybefka2)prop_insertMaybe'_withmp(k,a1,a2,f)=(f=<<Justa1)==(doWithka1mp$insertMaybe'fka2)prop_insertMaybe'_withoutmp(k,a2,f)=Justa2==(doWithoutkmp$insertMaybe'fka2)-- Dont test insertAssocs yet, still not sure whether to include themprop_delete_withmp(k,a)=Nothing==(doWithkamp$deletek)prop_delete_withoutmpk=Nothing==(doWithoutkmp$deletek)prop_adjustWith_withmp(k,a,f)=Just(fa)==(doWithkamp$adjustWithfk)prop_adjustWith_withoutmp(k,f)=Nothing==(doWithoutkmp$adjustWithfk)prop_adjustWith'_withmp(k,a,f)=Just(fa)==(doWithkamp$adjustWith'fk)prop_adjustWith'_withoutmp(k,f)=Nothing==(doWithoutkmp$adjustWith'fk)prop_adjustMaybe_withmp(k,a,f)=(f=<<Justa)==(doWithkamp$adjustMaybefk)prop_adjustMaybe_withoutmp(k,f)=Nothing==(doWithoutkmp$adjustMaybefk)prop_adjustMaybe'_withmp(k,a,f)=(f=<<Justa)==(doWithkamp$adjustMaybe'fk)prop_adjustMaybe'_withoutmp(k,f)=Nothing==(doWithoutkmp$adjustMaybe'fk)-- The various merges are better tested by the comparison testsprop_isSubsetOfmpas=isSubsetOfmp(insertAssocsasmp)prop_isSubmapOfmp(f,as)=isSubmapOf(\ab->fa==b)mp((mapf$insertAssocsWithconstasmp)`like`mp)prop_mapmp(k,a,f)=Just(fa)==(doWithkamp$\mp->mapfmp`like`mp)prop_map'mp(k,a,f)=Just(fa)==(doWithkamp$\mp->map'fmp`like`mp)prop_mapMaybemp(k,a,f)=(f=<<Justa)==(doWithkamp$\mp->G.mapMaybefmp`like`mp)prop_mapMaybe'mp(k,a,f)=(f=<<Justa)==(doWithkamp$\mp->G.mapMaybe'fmp`like`mp)prop_mapWithKeymp(k,a,f)=Just(fka)==(doWithkamp$\mp->mapWithKeyfmp`like`mp)prop_mapWithKey'mp(k,a,f)=Just(fka)==(doWithkamp$\mp->mapWithKey'fmp`like`mp)prop_filter_inmp(k,a)=Justa==(doWithkamp$G.filter(a==))prop_filter_outmp(k,a)=Nothing==(doWithkamp$G.filter(a/=))-- Dont yet know how to test folds. Need to randomly produce an associative function (or use const and lookup?)prop_validmp()=Nothing==validmp-- ### Strictness tests for OrderedMap ###-- For lazy funs make every resulting elem bottom-- For strict funs make a single resulting elem bottomisMaybeBottoma=(not$isBottoma)&&caseaofNothing->TrueJusta'->isBottoma'isLazyAltermpkf=letmp'=fmp`like`mpin(not$isBottommp')&&(isMaybeBottom$lookupkmp')isStrictAltermpkf=letmp'=fmp`like`mpinisBottommp'prop_lazy_altermpk=isLazyAltermpk$alter(\a->Justbottom)kprop_strict_alter'mpk=isStrictAltermpk$alter'(\a->Justbottom)kprop_lazy_insertWithmpk=isLazyAltermpk$insertWith(\a->bottom)kbottom-- insertWith' is currently only strict if the key already exists-- !!! Remember to change this test if the semantics of insertWith' are changedprop_strict_insertWith'mp(k,a)=isStrictAlter(insertkamp)k$insertWith'(\a->bottom)kbottomprop_lazy_insertMaybempk=isLazyAltermpk$insertMaybe(\a->Justbottom)kbottom-- insertMaybe' is currently only strict if the key already exists-- !!! Remember to change this test if the semantics of insertMaybe' are changedprop_strict_insertMaybe'mp(k,a)=isStrictAlter(insertkamp)k$insertMaybe'(\a->Justbottom)kbottom-- For adjusts we need to ensure that k is in the mapprop_lazy_adjustWithmp(k,a)=isLazyAlter(insertkamp)k$adjustWith(\a->bottom)kprop_strict_adjustWith'mp(k,a)=isStrictAlter(insertkamp)k$adjustWith'(\a->bottom)kprop_lazy_adjustMaybemp(k,a)=isLazyAlter(insertkamp)k$adjustMaybe(\a->Justbottom)kprop_strict_adjustMaybe'mp(k,a)=isStrictAlter(insertkamp)k$adjustMaybe'(\a->Justbottom)kisLazyMerge::OrderedMapmapk=>mapa->mapa->k->(mapa->mapa->mapa)->BoolisLazyMergemp1mp2kf=letmp'=fmp1mp2`like`mp1in(not$isBottommp')&&(isMaybeBottom$lookupkmp')isStrictMerge::OrderedMapmapk=>mapa->mapa->k->(mapa->mapa->mapa)->BoolisStrictMergemp1mp2kf=letmp'=fmp1mp2`like`mp1inisBottommp'sel1(a,b,c)=asel2(a,b,c)=bsel3(a,b,c)=c-- For merge tests need to ensure that resulting map has at least one assoc or the tests dont work-- Many of these tests need to have a shared key in both maps.prop2_lazy_venn_left(mp1,mp2)(k)=isLazyMerge(map(constbottom)(insertkbottommp1))(deletekmp2)k$(sel1`on`vennconst)prop2_lazy_venn_inter(mp1,mp2)(k,a)=isLazyMerge(insertkamp1)(insertkamp2)k$(sel2`on`venn(\ab->bottom))prop2_lazy_venn_right(mp1,mp2)(k)=isLazyMerge(deletekmp1)(map(constbottom)(insertkbottommp2))k$(sel3`on`vennconst)prop2_strict_venn'_inter(mp1,mp2)(k,a)=isStrictMerge(insertkbottommp1)(insertkamp2)k$(sel2`on`venn'const)prop2_lazy_union(mp1,mp2)(k,a)=isLazyMerge(insertkamp1)(insertkamp2)k$union(\ab->bottom)prop2_strict_union'(mp1,mp2)(k,a)=isStrictMerge(insertkamp1)(insertkbottommp2)k$union'(\ab->a`seq`b`seq`a)prop2_lazy_unionMaybe(mp1,mp2)(k,a)=isLazyMerge(insertkamp1)(insertkamp2)k$unionMaybe(\ab->Justbottom)prop2_strict_unionMaybe'(mp1,mp2)(k,a)=isStrictMerge(insertkamp1)(insertkbottommp2)k$unionMaybe'(\ab->a`seq`b`seq`Justa)prop2_lazy_intersection(mp1,mp2)(k,a)=isLazyMerge(insertkamp1)(insertkamp2)k$intersection(\ab->bottom)prop2_strict_intersection'(mp1,mp2)(k,a)=isStrictMerge(insertkamp1)(insertkbottommp2)k$intersection'(\ab->a`seq`b`seq`a)prop2_lazy_intersectionMaybe(mp1,mp2)(k,a)=isLazyMerge(insertkamp1)(insertkamp2)k$intersectionMaybe(\ab->Justbottom)prop2_strict_intersectionMaybe'(mp1,mp2)(k,a)=isStrictMerge(insertkamp1)(insertkbottommp2)k$intersectionMaybe'(\ab->a`seq`b`seq`Justa)prop2_lazy_differenceMaybe(mp1,mp2)(k,a)=isLazyMerge(insertkamp1)(insertkamp2)k$differenceMaybe(\ab->Justbottom)prop2_strict_differenceMaybe'(mp1,mp2)(k,a)=isStrictMerge(insertkamp1)(insertkbottommp2)k$differenceMaybe'(\ab->a`seq`b`seq`Justa)-- Need to have a nonEmpty OrderedMap to test strictness of mapprop_lazy_mapmp(k,a)=isLazyAlter(insertkamp)k$map(\a'->bottom)prop_strict_map'mp(k,a)=isStrictAlter(insertkamp)k$map'(\a'->if(a==a')thenbottomelsea')prop_lazy_mapMaybemp(k,a)=isLazyAlter(insertkamp)k$G.mapMaybe(\a'->Justbottom)prop_strict_mapMaybe'mp(k,a)=isStrictAlter(insertkamp)k$G.mapMaybe'(\a'->if(a==a')then(Justbottom)else(Justa'))prop_lazy_mapWithKeymp(k,a)=isLazyAlter(insertkamp)k$mapWithKey(\k'a'->bottom)prop_strict_mapWithKey'mp(k,a)=isStrictAlter(insertkamp)k$mapWithKey'(\k'a'->if((k',a')==(k,a))thenbottomelsea')-- Lazy and strict folds are identical if the map has zero or one assocs so we must ensure that they have at least two assocs-- We test folds by ensuring that the first accumalated value is bottom and the rest are Justs.foldArgab|isBottomb=Justa|isNothingb=bottom|otherwise=JustafoldArgK_=foldArgprop_lazy_foldKeysmp((k1,a1),(k2,a2))=k1/=k2==>not$isBottom$foldKeysfoldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mpprop_strict_foldKeys'mp((k1,a1),(k2,a2))=k1/=k2==>isBottom$foldKeys'foldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mpprop_lazy_foldElemsmp((k1,a1),(k2,a2))=k1/=k2==>not$isBottom$foldElemsfoldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mpprop_strict_foldElems'mp((k1,a1),(k2,a2))=k1/=k2==>isBottom$foldElems'foldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mpprop_lazy_foldAssocsmp((k1,a1),(k2,a2))=k1/=k2==>not$isBottom$foldAssocsfoldArgKNothing$insertAssocs[(k1,a1),(k2,a2)]mpprop_strict_foldAssocs'mp((k1,a1),(k2,a2))=k1/=k2==>isBottom$foldAssocs'foldArgKNothing$insertAssocs[(k1,a1),(k2,a2)]mp-- ### Comparisons to AList ###comp_emptymp()=assocsAsc(empty`like`mp)comp_singletonmp(k,a)=assocsAsc(singletonka`like`mp)comp_pairmp(k1,k2,a1,a2)=fmapassocsAsc((fmap(\f->fa1a2)(pairk1k2))`like`(Justmp))comp_statusmp()=statusmpcomp_nonEmptymp()=fmapassocsAsc$nonEmptympcomp_addSizemp(I#i)=I#(addSizempi)comp_lookupmpk=lookupkmpcomp_lookupContmp(k,f)=lookupContfkmp`likeMaybeElem`mpcomp_altermp(k,f)=assocsAsc$alterfkmpcomp_alter'mp(k,f)=assocsAsc$alter'fkmpcomp_insertWithmp(k,a,f)=assocsAsc$insertWithfkampcomp_insertWith'mp(k,a,f)=assocsAsc$insertWith'fkamp-- comp_insertAssocsWith : Waiting on updates to OrderedMap api-- comp_insertAssocsMaybecomp_insertMaybemp(k,a,f)=assocsAsc$insertMaybefkampcomp_insertMaybe'mp(k,a,f)=assocsAsc$insertMaybe'fkampcomp_deletempk=assocsAsc$deletekmpcomp_adjustWithmp(k,f)=assocsAsc$adjustWithfkmpcomp_adjustWith'mp(k,f)=assocsAsc$adjustWith'fkmpcomp_adjustMaybemp(k,f)=assocsAsc$adjustMaybefkmpcomp_adjustMaybe'mp(k,f)=assocsAsc$adjustMaybe'fkmp-- Why dont tuple functors work properly?-- Note that the type is more constrained than venn.vennAssocs::(OrderedMapmapk,Ordk)=>(mapa,mapa,mapa)->([(k,a)],[(k,a)],[(k,a)])vennAssocs(mpa,mpc,mpb)=(assocsAscmpa,assocsAscmpc,assocsAscmpb)comp2_venn(mp1,mp2)f=vennAssocs$vennfmp1mp2comp2_venn'(mp1,mp2)f=vennAssocs$venn'fmp1mp2comp2_vennMaybe(mp1,mp2)f=vennAssocs$vennMaybefmp1mp2-- Use venn to obtain disjoint maps - so relies on venn being correctcomp2_disjointUnion(mp1,mp2)()=assocsAsc$disjointUnionleftright`like`mp1`like`mp2where(left,_,right)=vennconstmp1mp2comp2_union(mp1,mp2)f=assocsAsc$unionfmp1mp2`like`mp1`like`mp2comp2_union'(mp1,mp2)f=assocsAsc$union'fmp1mp2`like`mp1`like`mp2comp2_unionMaybe(mp1,mp2)f=assocsAsc$unionMaybefmp1mp2`like`mp1`like`mp2comp2_unionMaybe'(mp1,mp2)f=assocsAsc$unionMaybe'fmp1mp2`like`mp1`like`mp2comp2_intersection(mp1,mp2)f=assocsAsc$intersectionfmp1mp2`like`mp1`like`mp2comp2_intersection'(mp1,mp2)f=assocsAsc$intersection'fmp1mp2`like`mp1`like`mp2comp2_intersectionMaybe(mp1,mp2)f=assocsAsc$intersectionMaybefmp1mp2`like`mp1`like`mp2comp2_intersectionMaybe'(mp1,mp2)f=assocsAsc$intersectionMaybe'fmp1mp2`like`mp1`like`mp2comp2_difference(mp1,mp2)()=assocsAsc$differencemp1mp2`like`mp1`like`mp2comp2_differenceMaybe(mp1,mp2)f=assocsAsc$differenceMaybefmp1mp2`like`mp1`like`mp2comp2_differenceMaybe'(mp1,mp2)f=assocsAsc$differenceMaybe'fmp1mp2`like`mp1`like`mp2comp2_isSubsetOf(mp1,mp2)()=isSubsetOfmp1mp2comp2_isSubmapOf(mp1,mp2)f=isSubmapOffmp1mp2comp_mapmpf=assocsAsc$G.mapfmp`like`mpcomp_map'mpf=assocsAsc$G.map'fmp`like`mpcomp_mapMaybempf=assocsAsc$G.mapMaybefmp`like`mpcomp_mapMaybe'mpf=assocsAsc$G.mapMaybe'fmp`like`mpcomp_mapWithKeympf=assocsAsc$G.mapWithKeyfmp`like`mpcomp_mapWithKey'mpf=assocsAsc$G.mapWithKey'fmp`like`mpcomp_filtermpf=assocsAsc$G.filterfmpcomp_insertmp(k,a)=assocsAsc$insertkamp-- Dont compare folds because they depend on orderingcomp_sizemp()=sizempcomp_insertAssocsmpas=assocsAsc$insertAssocsasmpcomp_fromAssocsmpas=assocsAsc$fromAssocsas`like`mpcomp_fromAssocsWithmp(f,as)=assocsAsc$fromAssocsWithfas`like`mpcomp2_isProperSubsetOf(mp1,mp2)()=isProperSubsetOfmp1mp2comp2_isProperSubmapOfBy(mp1,mp2)f=isProperSubmapOfByfmp1mp2-- comp_lookupM : Need to fix monadcomp_keysmp()=mapSortKeysmp$keysmpcomp_elemsmp()=mapSortKeysmp$elemsmpcomp_assocsmp()=assocsAscmp-- ### Testing OrderedMap methods ###propO_keysAscmp()=keysAscmp==(L.mapfst$assocsAscmp)propO_keysDescmp()=keysDescmp==(L.mapfst$assocsDescmp)propO_elemsAscmp()=elemsAscmp==(L.mapsnd$assocsAscmp)propO_elemsDescmp()=elemsDescmp==(L.mapsnd$assocsDescmp)propO_assocsAscmp()=letas=assocsAscmpinL.sortBy(\(k1,_)(k2,_)->compareKeympk1k2)as==aspropO_assocsDescmp()=letas=assocsDescmpinL.sortBy(\(k1,_)(k2,_)->compareKeympk2k1)as==as-- ### Strictness tests for OrderedMap ###propO_lazy_foldKeysAscmp((k1,a1),(k2,a2))=k1/=k2==>not$isBottom$foldKeysAscfoldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_strict_foldKeysAsc'mp((k1,a1),(k2,a2))=k1/=k2==>isBottom$foldKeysAsc'foldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_lazy_foldKeysDescmp((k1,a1),(k2,a2))=k1/=k2==>not$isBottom$foldKeysDescfoldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_strict_foldKeysDesc'mp((k1,a1),(k2,a2))=k1/=k2==>isBottom$foldKeysDesc'foldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_lazy_foldElemsAscmp((k1,a1),(k2,a2))=k1/=k2==>not$isBottom$foldElemsAscfoldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_strict_foldElemsAsc'mp((k1,a1),(k2,a2))=k1/=k2==>isBottom$foldElemsAsc'foldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_lazy_foldElemsDescmp((k1,a1),(k2,a2))=k1/=k2==>not$isBottom$foldElemsDescfoldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_strict_foldElemsDesc'mp((k1,a1),(k2,a2))=k1/=k2==>isBottom$foldElemsDesc'foldArgNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_lazy_foldAssocsAscmp((k1,a1),(k2,a2))=k1/=k2==>not$isBottom$foldAssocsAscfoldArgKNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_strict_foldAssocsAsc'mp((k1,a1),(k2,a2))=k1/=k2==>isBottom$foldAssocsAsc'foldArgKNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_lazy_foldAssocsDescmp((k1,a1),(k2,a2))=k1/=k2==>not$isBottom$foldAssocsDescfoldArgKNothing$insertAssocs[(k1,a1),(k2,a2)]mppropO_strict_foldAssocsDesc'mp((k1,a1),(k2,a2))=k1/=k2==>isBottom$foldAssocsDesc'foldArgKNothing$insertAssocs[(k1,a1),(k2,a2)]mpkeyedLike::OrderedMapmapk=>mapa->mapb->mapakeyedLikemp_=mppropO_nubAscWithmpas=(nubAscWith(empty`keyedLike`mp)as)==(mapSortKeysmp$L.nubas)propO_nubDescWithmpas=(nubDescWith(empty`keyedLike`mp)as)==(reverse$mapSortKeysmp$L.nubas)propO_sortAscWithmpas=(sortAscWith(empty`keyedLike`mp)as)==(mapSortKeysmpas)propO_sortDescWithmpas=(sortDescWith(empty`keyedLike`mp)as)==(reverse$mapSortKeysmpas)-- Most methods better tested by comparisons to SList-- ### Comparisons to SList ###-- comp_compareKey : Useless because of the newtyping required for SListcompO_fromAssocsAscWithmp(f,as)=assocsAsc$fromAssocsAscWithf(mapSortAssocsmpas)`like`mpcompO_fromAssocsDescWithmp(f,as)=assocsAsc$fromAssocsDescWithf(reverse$mapSortAssocsmpas)`like`mpcompO_fromAssocsAscMaybemp(f,as)=assocsAsc$fromAssocsAscMaybef(mapSortAssocsmpas)`like`mpcompO_fromAssocsDescMaybemp(f,as)=assocsAsc$fromAssocsDescMaybef(reverse$mapSortAssocsmpas)`like`mpcompO_insertAssocsAscWithmp(f,as)=assocsAsc$insertAssocsAscWithf(mapSortAssocsmpas)mpcompO_insertAssocsDescWithmp(f,as)=assocsAsc$insertAssocsDescWithf(reverse$mapSortAssocsmpas)mpcompO_insertAssocsAscMaybemp(f,as)=assocsAsc$insertAssocsAscMaybef(mapSortAssocsmpas)mpcompO_insertAssocsDescMaybemp(f,as)=assocsAsc$insertAssocsDescMaybef(reverse$mapSortAssocsmpas)mpcompO_foldElemsAscmp(f,b)=foldElemsAscfbmp`likeElem`mpcompO_foldElemsDescmp(f,b)=foldElemsDescfbmp`likeElem`mpcompO_foldElemsAsc'mp(f,b)=foldElemsAsc'fbmp`likeElem`mpcompO_foldElemsDesc'mp(f,b)=foldElemsDesc'fbmp`likeElem`mpcompO_foldKeysAscmp(f,b)=foldKeysAscfbmp`likeElem`mpcompO_foldKeysDescmp(f,b)=foldKeysDescfbmp`likeElem`mpcompO_foldKeysAsc'mp(f,b)=foldKeysAsc'fbmp`likeElem`mpcompO_foldKeysDesc'mp(f,b)=foldKeysDesc'fbmp`likeElem`mpcompO_foldAssocsAscmp(f,b)=foldAssocsAscfbmp`likeElem`mpcompO_foldAssocsDescmp(f,b)=foldAssocsDescfbmp`likeElem`mpcompO_foldAssocsAsc'mp(f,b)=foldAssocsAsc'fbmp`likeElem`mpcompO_foldAssocsDesc'mp(f,b)=foldAssocsDesc'fbmp`likeElem`mpcompO_elemsAscmp()=elemsAscmpcompO_elemsDescmp()=elemsDescmpcompO_keysAscmp()=keysAscmpcompO_keysDescmp()=keysDescmpcompO_assocsAscmp()=assocsAscmpcompO_assocsDescmp()=assocsDescmp-- Partitions, sorts not yet implemented so not tested.-- ### Testing OrdMap methods ###-- prop_compareKey mp (k1,k2) =-- compareKey mp k1 k2 == compare k1 k2-- ### Scripts to collate tests ###propList=testList"Test/GMap.hs""prop_""SimpleTest "props=[(SimpleTestprop_lookup_empty,"prop_lookup_empty"),(SimpleTestprop_lookup_singleton,"prop_lookup_singleton"),(SimpleTestprop_insert_with,"prop_insert_with"),(SimpleTestprop_insert_without,"prop_insert_without"),(SimpleTestprop_insertWith_with,"prop_insertWith_with"),(SimpleTestprop_insertWith_without,"prop_insertWith_without"),(SimpleTestprop_insertWith'_with,"prop_insertWith'_with"),(SimpleTestprop_insertWith'_without,"prop_insertWith'_without"),(SimpleTestprop_insertMaybe_with,"prop_insertMaybe_with"),(SimpleTestprop_insertMaybe_without,"prop_insertMaybe_without"),(SimpleTestprop_insertMaybe'_with,"prop_insertMaybe'_with"),(SimpleTestprop_insertMaybe'_without,"prop_insertMaybe'_without"),(SimpleTestprop_delete_with,"prop_delete_with"),(SimpleTestprop_delete_without,"prop_delete_without"),(SimpleTestprop_adjustWith_with,"prop_adjustWith_with"),(SimpleTestprop_adjustWith_without,"prop_adjustWith_without"),(SimpleTestprop_adjustWith'_with,"prop_adjustWith'_with"),(SimpleTestprop_adjustWith'_without,"prop_adjustWith'_without"),(SimpleTestprop_adjustMaybe_with,"prop_adjustMaybe_with"),(SimpleTestprop_adjustMaybe_without,"prop_adjustMaybe_without"),(SimpleTestprop_adjustMaybe'_with,"prop_adjustMaybe'_with"),(SimpleTestprop_adjustMaybe'_without,"prop_adjustMaybe'_without"),(SimpleTestprop_isSubsetOf,"prop_isSubsetOf"),(SimpleTestprop_isSubmapOf,"prop_isSubmapOf"),(SimpleTestprop_map,"prop_map"),(SimpleTestprop_map',"prop_map'"),(SimpleTestprop_mapMaybe,"prop_mapMaybe"),(SimpleTestprop_mapMaybe',"prop_mapMaybe'"),(SimpleTestprop_mapWithKey,"prop_mapWithKey"),(SimpleTestprop_mapWithKey',"prop_mapWithKey'"),(SimpleTestprop_filter_in,"prop_filter_in"),(SimpleTestprop_filter_out,"prop_filter_out"),(SimpleTestprop_valid,"prop_valid"),(SimpleTestprop_lazy_alter,"prop_lazy_alter"),(SimpleTestprop_strict_alter',"prop_strict_alter'"),(SimpleTestprop_lazy_insertWith,"prop_lazy_insertWith"),(SimpleTestprop_strict_insertWith',"prop_strict_insertWith'"),(SimpleTestprop_lazy_insertMaybe,"prop_lazy_insertMaybe"),(SimpleTestprop_strict_insertMaybe',"prop_strict_insertMaybe'"),(SimpleTestprop_lazy_adjustWith,"prop_lazy_adjustWith"),(SimpleTestprop_strict_adjustWith',"prop_strict_adjustWith'"),(SimpleTestprop_lazy_adjustMaybe,"prop_lazy_adjustMaybe"),(SimpleTestprop_strict_adjustMaybe',"prop_strict_adjustMaybe'"),(SimpleTestprop_lazy_map,"prop_lazy_map"),(SimpleTestprop_strict_map',"prop_strict_map'"),(SimpleTestprop_lazy_mapMaybe,"prop_lazy_mapMaybe"),(SimpleTestprop_strict_mapMaybe',"prop_strict_mapMaybe'"),(SimpleTestprop_lazy_mapWithKey,"prop_lazy_mapWithKey"),(SimpleTestprop_strict_mapWithKey',"prop_strict_mapWithKey'"),(SimpleTestprop_lazy_foldKeys,"prop_lazy_foldKeys"),(SimpleTestprop_strict_foldKeys',"prop_strict_foldKeys'"),(SimpleTestprop_lazy_foldElems,"prop_lazy_foldElems"),(SimpleTestprop_strict_foldElems',"prop_strict_foldElems'"),(SimpleTestprop_lazy_foldAssocs,"prop_lazy_foldAssocs"),(SimpleTestprop_strict_foldAssocs',"prop_strict_foldAssocs'")]compList=testList"Test/GMap.hs""comp_""compareTest "comps=[(compareTestcomp_empty,"comp_empty"),(compareTestcomp_singleton,"comp_singleton"),(compareTestcomp_pair,"comp_pair"),(compareTestcomp_status,"comp_status"),(compareTestcomp_nonEmpty,"comp_nonEmpty"),(compareTestcomp_addSize,"comp_addSize"),(compareTestcomp_lookup,"comp_lookup"),(compareTestcomp_lookupCont,"comp_lookupCont"),(compareTestcomp_alter,"comp_alter"),(compareTestcomp_alter',"comp_alter'"),(compareTestcomp_insertWith,"comp_insertWith"),(compareTestcomp_insertWith',"comp_insertWith'"),(compareTestcomp_insertMaybe,"comp_insertMaybe"),(compareTestcomp_insertMaybe',"comp_insertMaybe'"),(compareTestcomp_delete,"comp_delete"),(compareTestcomp_adjustWith,"comp_adjustWith"),(compareTestcomp_adjustWith',"comp_adjustWith'"),(compareTestcomp_adjustMaybe,"comp_adjustMaybe"),(compareTestcomp_adjustMaybe',"comp_adjustMaybe'"),(compareTestcomp_map,"comp_map"),(compareTestcomp_map',"comp_map'"),(compareTestcomp_mapMaybe,"comp_mapMaybe"),(compareTestcomp_mapMaybe',"comp_mapMaybe'"),(compareTestcomp_mapWithKey,"comp_mapWithKey"),(compareTestcomp_mapWithKey',"comp_mapWithKey'"),(compareTestcomp_filter,"comp_filter"),(compareTestcomp_insert,"comp_insert"),(compareTestcomp_size,"comp_size"),(compareTestcomp_insertAssocs,"comp_insertAssocs"),(compareTestcomp_fromAssocs,"comp_fromAssocs"),(compareTestcomp_fromAssocsWith,"comp_fromAssocsWith"),(compareTestcomp_keys,"comp_keys"),(compareTestcomp_elems,"comp_elems"),(compareTestcomp_assocs,"comp_assocs")]prop2List=testList"Test/GMap.hs""prop2_""SimpleTest2 "prop2s=[(SimpleTest2prop2_lazy_venn_left,"prop2_lazy_venn_left"),(SimpleTest2prop2_lazy_venn_inter,"prop2_lazy_venn_inter"),(SimpleTest2prop2_lazy_venn_right,"prop2_lazy_venn_right"),(SimpleTest2prop2_strict_venn'_inter,"prop2_strict_venn'_inter"),(SimpleTest2prop2_lazy_union,"prop2_lazy_union"),(SimpleTest2prop2_strict_union',"prop2_strict_union'"),(SimpleTest2prop2_lazy_unionMaybe,"prop2_lazy_unionMaybe"),(SimpleTest2prop2_strict_unionMaybe',"prop2_strict_unionMaybe'"),(SimpleTest2prop2_lazy_intersection,"prop2_lazy_intersection"),(SimpleTest2prop2_strict_intersection',"prop2_strict_intersection'"),(SimpleTest2prop2_lazy_intersectionMaybe,"prop2_lazy_intersectionMaybe"),(SimpleTest2prop2_strict_intersectionMaybe',"prop2_strict_intersectionMaybe'"),(SimpleTest2prop2_lazy_differenceMaybe,"prop2_lazy_differenceMaybe"),(SimpleTest2prop2_strict_differenceMaybe',"prop2_strict_differenceMaybe'")]comp2List=testList"Test/GMap.hs""comp2_""compareTest2 "comp2s=[(compareTest2comp2_venn,"comp2_venn"),(compareTest2comp2_venn',"comp2_venn'"),(compareTest2comp2_vennMaybe,"comp2_vennMaybe"),(compareTest2comp2_disjointUnion,"comp2_disjointUnion"),(compareTest2comp2_union,"comp2_union"),(compareTest2comp2_union',"comp2_union'"),(compareTest2comp2_unionMaybe,"comp2_unionMaybe"),(compareTest2comp2_unionMaybe',"comp2_unionMaybe'"),(compareTest2comp2_intersection,"comp2_intersection"),(compareTest2comp2_intersection',"comp2_intersection'"),(compareTest2comp2_intersectionMaybe,"comp2_intersectionMaybe"),(compareTest2comp2_intersectionMaybe',"comp2_intersectionMaybe'"),(compareTest2comp2_difference,"comp2_difference"),(compareTest2comp2_differenceMaybe,"comp2_differenceMaybe"),(compareTest2comp2_differenceMaybe',"comp2_differenceMaybe'"),(compareTest2comp2_isSubsetOf,"comp2_isSubsetOf"),(compareTest2comp2_isSubmapOf,"comp2_isSubmapOf"),(compareTest2comp2_isProperSubsetOf,"comp2_isProperSubsetOf"),(compareTest2comp2_isProperSubmapOfBy,"comp2_isProperSubmapOfBy")]propOList=testList"Test/GMap.hs""propO_""SimpleTest "propOs=[(SimpleTestpropO_keysAsc,"propO_keysAsc"),(SimpleTestpropO_keysDesc,"propO_keysDesc"),(SimpleTestpropO_elemsAsc,"propO_elemsAsc"),(SimpleTestpropO_elemsDesc,"propO_elemsDesc"),(SimpleTestpropO_assocsAsc,"propO_assocsAsc"),(SimpleTestpropO_assocsDesc,"propO_assocsDesc"),(SimpleTestpropO_lazy_foldKeysAsc,"propO_lazy_foldKeysAsc"),(SimpleTestpropO_strict_foldKeysAsc',"propO_strict_foldKeysAsc'"),(SimpleTestpropO_lazy_foldKeysDesc,"propO_lazy_foldKeysDesc"),(SimpleTestpropO_strict_foldKeysDesc',"propO_strict_foldKeysDesc'"),(SimpleTestpropO_lazy_foldElemsAsc,"propO_lazy_foldElemsAsc"),(SimpleTestpropO_strict_foldElemsAsc',"propO_strict_foldElemsAsc'"),(SimpleTestpropO_lazy_foldElemsDesc,"propO_lazy_foldElemsDesc"),(SimpleTestpropO_strict_foldElemsDesc',"propO_strict_foldElemsDesc'"),(SimpleTestpropO_lazy_foldAssocsAsc,"propO_lazy_foldAssocsAsc"),(SimpleTestpropO_strict_foldAssocsAsc',"propO_strict_foldAssocsAsc'"),(SimpleTestpropO_lazy_foldAssocsDesc,"propO_lazy_foldAssocsDesc"),(SimpleTestpropO_strict_foldAssocsDesc',"propO_strict_foldAssocsDesc'"),(SimpleTestpropO_nubAscWith,"propO_nubAscWith"),(SimpleTestpropO_nubDescWith,"propO_nubDescWith"),(SimpleTestpropO_sortAscWith,"propO_sortAscWith"),(SimpleTestpropO_sortDescWith,"propO_sortDescWith")]compOList=testList"Test/GMap.hs""compO_""compareTest "compOs=[(compareTestcompO_fromAssocsAscWith,"compO_fromAssocsAscWith"),(compareTestcompO_fromAssocsDescWith,"compO_fromAssocsDescWith"),(compareTestcompO_fromAssocsAscMaybe,"compO_fromAssocsAscMaybe"),(compareTestcompO_fromAssocsDescMaybe,"compO_fromAssocsDescMaybe"),(compareTestcompO_insertAssocsAscWith,"compO_insertAssocsAscWith"),(compareTestcompO_insertAssocsDescWith,"compO_insertAssocsDescWith"),(compareTestcompO_insertAssocsAscMaybe,"compO_insertAssocsAscMaybe"),(compareTestcompO_insertAssocsDescMaybe,"compO_insertAssocsDescMaybe"),(compareTestcompO_foldElemsAsc,"compO_foldElemsAsc"),(compareTestcompO_foldElemsDesc,"compO_foldElemsDesc"),(compareTestcompO_foldElemsAsc',"compO_foldElemsAsc'"),(compareTestcompO_foldElemsDesc',"compO_foldElemsDesc'"),(compareTestcompO_foldKeysAsc,"compO_foldKeysAsc"),(compareTestcompO_foldKeysDesc,"compO_foldKeysDesc"),(compareTestcompO_foldKeysAsc',"compO_foldKeysAsc'"),(compareTestcompO_foldKeysDesc',"compO_foldKeysDesc'"),(compareTestcompO_foldAssocsAsc,"compO_foldAssocsAsc"),(compareTestcompO_foldAssocsDesc,"compO_foldAssocsDesc"),(compareTestcompO_foldAssocsAsc',"compO_foldAssocsAsc'"),(compareTestcompO_foldAssocsDesc',"compO_foldAssocsDesc'"),(compareTestcompO_elemsAsc,"compO_elemsAsc"),(compareTestcompO_elemsDesc,"compO_elemsDesc"),(compareTestcompO_keysAsc,"compO_keysAsc"),(compareTestcompO_keysDesc,"compO_keysDesc"),(compareTestcompO_assocsAsc,"compO_assocsAsc"),(compareTestcompO_assocsDesc,"compO_assocsDesc")]unorderedTests=props++prop2s++comps++comp2s-- Cant currently run tests on unordered maps. Easily changed if you complain at meallTests=props++propOs++prop2s++comps++compOs++comp2s-- ### Some ready made test types ###testSList=undefined::OListInt(Int,Int)testUnitMap=undefined::UnitMapInttestEitherMap=undefined::EitherMap(OListInt)(OListBool)IntBoolInttestMaybeMap=undefined::MaybeMap(OListInt)IntInttestOrdMap=undefined::OrdMapIntInttestEnumMap=undefined::EnumMapBoolInttestIntMap=undefined::IntMapInttestListMap=undefined::ListMap(OListInt)IntInttestListOrdMap=undefined::ListMap(OrdMapChar)CharInttestListIntMap=undefined::ListMapIntMapIntInt-- testSerialMap = undefined :: SerialMap Int Int-- testSerialMap2 = undefined :: SerialMap String Int -- !!! Define arbitrary for some more interesting serialisable types.-- testCacheKeysSerialMap = undefined :: CacheKeys (SerialMap String) String InttestTuple2Map=undefined::Tuple2Map(OListInt)(EnumMapBool)IntBoolInttestTuple3Map=undefined::Tuple3Map(OListInt)(EnumMapBool)IntMapIntBoolIntInttestTuple4Map=undefined::Tuple4Map(OListInt)(EnumMapBool)IntMap(OrdMapChar)IntBoolIntCharInttestTuple5Map=undefined::Tuple5Map(OListInt)(EnumMapBool)IntMap(OrdMapChar)(OrdMapString)IntBoolIntCharStringInttestChoice2Map=undefined::Choice2Map(OListInt)(EnumMapBool)IntBoolInttestChoice3Map=undefined::Choice3Map(OListInt)(EnumMapBool)IntMapIntBoolIntInttestChoice4Map=undefined::Choice4Map(OListInt)(EnumMapBool)IntMap(OrdMapChar)IntBoolIntCharInttestChoice5Map=undefined::Choice5Map(OListInt)(EnumMapBool)IntMap(OrdMapChar)(OrdMapString)IntBoolIntCharStringInt-- testBitMap = undefined :: SafeBitMap Int-- testUnrollMap = undefined :: UnrollMap Int