About

Comparison Testing Library

Advanced

Advanced comparisons

Shortcut

Shortcuts

Shortcuts for some common types of checks:
T()
Check for a True value
F()
Check for a false (but existant) value
D()
Check for a defined value
DNE()
Check that no value exists
FDNE()
Check for either false or DNE
These are most useful for checking bounds in a 'like', or ensuring something is present, but not caring what it is.
Pattern

Pattern Matching

match
Check that the value matches the pattern
mismatch
Check that the value does not match the pattern
Custom

Custom Checks

string
Explicit string compare
number
Explicit number compare
validator
Custom sub as a check
exact_ref
Check for an exact reference
Sets

Set Checks

in_set
Check that the value is in the set
not_in_set
Check that the value is not in the set
check_set
Check that the value matches everything in the set
Arrays

Array Checks

array
Declare an array check
item
Declare an array item
filter_items
Apply a filter to the remaining array items
end
Declare the end of the array
Hashes

Hash Checks

hash
Declare a hash
field
Declare a hash field
end
Declare that there are no more fields
Meta

Meta Checks

meta
Declare a meta check
prop
Declare a meta property to check
Objects

Object Checks

object
Declare an object check
call
Declare an object method result
prop
Declare a meta property
field
Declare a hash field (if object is a hash)
item
Declare an array item (if object is an array)
Note: methods are called in scalar context
Events

Event Checks

This is best when combined with intercept: