rgrannell1 / kea

Composable Functional Programming in R
16 stars 3 forks source link

Write tests for highly-used utility functions. #14

Closed rgrannell1 closed 10 years ago

rgrannell1 commented 10 years ago

I've recently written a script to generate a callgraph for Kea. Some functions are highly likely to be points of failure, like ddquote and summate, and themselves need tests.

throw_kea_error
262

False
261

%+%
261

fix
241

ddquote
147

summate
140

is_generic
112

is_atomic
111

as_typed_vector
44

True
41

match_fn
40

Null
36

throw_kea_warning
36

is_na
28

pluralise
26

params_of
26

elem_is_na
22

xSortBy
17

keep_names
17

xSumBy
16

xProdBy
16

xMinBy
16

xMaxBy
16

xSelect
16

xMap
16

xLimit
16

xTakeWhile
15

xReject
15

xGroupBy
15

xFlatMap
15

xDropWhile
15

xDelay
15

xDeepMap
15

xAnyOf
15

xTake
14

xScan
14

xReduce
14

xPoll
14

xLocate
14

xFold
14

xFlatten
14

xDrop
14

xDo
14

xCycle
14

xAllOf
14

is_nan
14

%!in%
14

execute_test
14

xSliceString
13

xRepeat
13

xRank
13

xOrderOf
13

xFix
13

xChunk
13

xChop
13

xChoose
13

xAt
13

xCompose
13

xStopwatch
13

xWrite
12

xThread
12

xSlice
12

xNoneOf
12

xMeanOf
12

xIndicesTo
12

xImplode
12

xExplode
12

xApply
12

load_test_dependencies
12

xAsDouble
12

elem_is_nan
12

xFormalsOf
12

xLift
12

xZipKeys
11

xWhere
11

xToWords
11

xToLines
11

xToChars
11

xTap
11

xShuffle
11

xRead
11

xNotMatch
11

xProdSetOf
11

xIterate
11

xIsMatch
11

xFromWords
11

xFromLines
11

xFromChars
11

xExecute
11

xAtKey
11

xAddKeys
11

xAsRaw
11

xAsLogical
11

xAsComplex
11

xAsCharacter
11

xZip
10

xUnzipIndices
10

xUnit
10

xUnionOf
10

xReverse
10

xRestOf
10

xNotSubset
10

xNotIn
10

[.xlist_builder
10

xJuxtapose
10

xJoin
10

xIsSuffixOf
10

xIsSubset
10

xIsPrefixOf
10

xIsInfixOf
10

xIsIn
10

xInterOf
10

xInitOf
10

xAsDataFrame
10

get_proto_ref
10

colourise
10

xValuesOf
9

xUnzipKeys
9

xUniqueOf
9

xThirdOf
9

xTabulate
9

xSpread
9

xSecondOf
9

xPrepend
9

xPowerSetOf
9

xOneOf
9

xNotEmpty
9

xNegate
9

xLenOf
9

xLastOf
9

xKeysOf
9

xIsEmpty
9

xIndicesOf
9

xFourthOf
9

xParamsOf
9

xFirstOf
9

xDuplicatesOf
9

xAppend
9

xUnspread
8

xIsVariadic
8

tryDefault
8

as_proto_params
8

xVal
7

xArityOf
7

Must_Be_Collection_Of_Collections
7

xIsVal
6

xAsVar
6

xAsVal
6

Must_Be_Orderable
6

Must_Be_Collection
6

suggest_similar_method
6

xAsInteger
6

throw_property_error
6

check_regexp
6

xZipKeys_
5

xZip_
5

xWhere_
5

xValuesOf_
5

xUnzipKeys_
5

xUnzipIndices_
5

xUnit_
5

xUniqueOf_
5

xUnionOf_
5

xThread_
5

xThirdOf_
5

xTakeWhile_
5

xTake_
5

xTabulate_
5

xSumBy_
5

xSortBy_
5

xSliceString_
5

xSlice_
5

xShuffle_
5

xSelect_
5

xSecondOf_
5

xScan_
5

xReverse_
5

xRestOf_
5

xRepeat_
5

xReject_
5

xReduce_
5

xRank_
5

xProdSetOf_
5

xProdBy_
5

xPrepend_
5

xPowerSetOf_
5

xPoll_
5

xOrderOf_
5

xOneOf_
5

xNotSubset_
5

xNotIn_
5

xNotEmpty_
5

xNoneOf_
5

xMinBy_
5

xMeanOf_
5

xMaxBy_
5

xMap_
5

xLocate_
5

xLift_
5

xLenOf_
5

xLastOf_
5

xKeysOf_
5

xJuxtapose_
5

xJoin_
5

xIsSuffixOf_
5

xIsSubset_
5

xIsPrefixOf_
5

xIsInfixOf_
5

xIsIn_
5

xIsEmpty_
5

xInterOf_
5

xInitOf_
5

xIndicesOf_
5

xImplode_
5

xGroupBy_
5

xFromWords_
5

xFromLines_
5

xFromChars_
5

xFourthOf_
5

xFold_
5

xFlatten_
5

xFlatMap_
5

xFix_
5

xFirstOf_
5

xDuplicatesOf_
5

xDropWhile_
5

xDrop_
5

xDo_
5

xDeepMap_
5

xCycle_
5

xCompose_
5

xChunk_
5

xChop_
5

xChoose_
5

xAtKey_
5

xAt_
5

xAsRaw_
5

xAsLogical_
5

xAsInteger_
5

xAsDouble_
5

xAsDataFrame_
5

xAsComplex_
5

xAsCharacter_
5

xApply_
5

xAppend_
5

xAnyOf_
5

xAllOf_
5

xAddKeys_
5

try_write
5

try_read
5

str_split
5

Must_Not_Contain_Nan
5

Must_Not_Contain_Na
5

Must_Have_Arity
5

Must_Be_Whole
5

Must_Be_Parametres_Of
5

Must_Be_Non_Nan
5

Must_All_Be_Whole
5

make_method
5

is_numeric
5

throw_exhaustion_warning
5

rsample
5

run_test
5

lookup_fn
5

as_formals
5

xNotNa
4

one_of
4

Must_Be_Of_Length
4

Must_Be_Non_Na
4

Must_Be_Named
4

Must_Be_Matchable
4

Must_Be_Longer_Than
4

Must_Be_Fn_Matchable
4

Must_Be_Flag
4

Must_Be_Finite
4

Must_Be_Equal_Length_To
4

Must_Be_Collection_Of_Lengths_In_Range
4

Must_Be_Collection_Of_Fn_Matchable
4

Must_Be_Collection_Of_Equal_Length
4

Must_All_Be_Indices
4

MakeVariadic
4

make_proto
4

worksWhen
4

is_raw
4

is_logical
4

is_integer
4

is_double
4

is_complex
4

is_character
4

stringify_call
4

get_call_components
4

failswhen_test
4

ddparse
4

call_with_params
4

xLambda
3

xK
3

xIsNa
3

xIdentity
3

xI
3

xCapture
3

x_
3

Try_Higher_Order_Function
3

print.kea
3

Must_Contain_Key
3

Must_Be_Positive_Index
3

Must_Be_File
3

Must_Be_Existing_Ref
3

Must_Be_Between
3

Must_Have_Canonical_Arguments
3

MakeFun
3

+.xforall
3

is_collection
3

holdsWhen
3

join_exprs
3

Fix
3

failsWhen
3

state_sucess
3

validate_test
3

is_variadic
3

is_unchaining
3

as_chaining
3

as_atom
3

:=
3

xNotTrue
2

xNotNull
2

xNotNan
2

xNotFalse
2

xNot
2

xList
2

xIsTrue
2

xIsNull
2

xIsNan
2

xIsFalse
2

xIs
2

xElemsByRows
2

xElemsByCols
2

xByValues
2

xByRows
2

xByRowkeys
2

xByLevels
2

xByCols
2

xByColkeys
2

x.
2

wrap
2

pick_one
2

one_gen
2

run
2

$.kea
2

ith_suffix
2

is_recursive
2

%is_in%
2

from_stream
2

fns_with_params
2

yield_case
2

parameterise
2

as_unchaining
2

kea_env
2

as_nonvariadic
2

xTruth
1

xIrrelevance
1

xFalsity
1

x__
1

write_error
1

Truth
1

%then%
1

rlistify
1

pick_one_
1

%or%
1

one_gen_
1

Na
1

Object
1

write_type_conversions
1

write_type_checks
1

over
1

is_named
1

has_variadic_param
1

x_any_proto
1

x_coll_proto
1

x_factor_proto
1

x_table_proto
1

x_function_proto
1

fixed_param
1

Falsity
1

holdswhen_test
1

describe
1

bmacro
1

as_variadic
1

as_named
1

%and%
1

add_field
1

xVersion
0

+.xlambda_builder
0

%%.xlambda_builder
0

%/%.xlambda_builder
0

&&.xlambda_builder
0

&.xlambda_builder
0

**.xlambda_builder
0

*.xlambda_builder
0

$.xlambda_builder
0

@.xlambda_builder
0

[[.xlambda_builder
0

[.xlambda_builder
0

/.xlambda_builder
0

!.xlambda_builder
0

!=.xlambda_builder
0

:.xlambda_builder
0

-.xlambda_builder
0

|.xlambda_builder
0

||.xlambda_builder
0

>.xlambda_builder
0

>=.xlambda_builder
0

==.xlambda_builder
0

<.xlambda_builder
0

<=.xlambda_builder
0

^.xlambda_builder
0

vectorise
0

proto_params
0

print.xlist_builder
0

listify
0

kea_fns
0

%is%
0

inject_expr
0
rgrannell1 commented 10 years ago

Added tests for the summate, %+%, ddquote, pluralise, and is_na.