|
Is there any possibility to define an optional hash-key for comparison?
I though about something like:
$data_expect = {
name => 'tester',
data => ignore(),
records => 0,
ignore('husband') => 'joey'
};
Here data can be of any type, but the hash key must exists, whereas for the haskey husband it is allowed to be non-existing at all, but if it exists it must still match 'joey' (ignore could be used to ignore that too).
Of course that would require that comparisions would check the hashkeys, not the values.
Any thoughts on that? |