Example
This is only an example.
Checked values are perl expressons.
>>> 'foo'
'foo'
>>> undef
undef
|
They are compared in deep manner.
>>> [1, 2, 3, { foo => 'bar' , bar => 'foo' }]
[1, 2, 3, { bar => 'foo' , foo => 'bar' }]
|
Multiline statements are supported.
>>> 90 / (
... 4 + 5
... )
10
|
Result could also be multiline
>>> [1, 2, 3, { foo => 'bar' , bar => 'foo' }]
[
1, 2, 3,
{ bar => 'foo' , foo => 'bar' }
]
|
Test::Deep helpers work
>>> [1, 2, 3, { foo => 'bar' , bar => 'foo' }]
[1, 2, 3, ignore]
>>> [1, 2, 3]
bag(3, 1, 2)
|
Original Test::Doctest one-line statements are supported too.
Variables that were localized inside pod block...
...are local to the end of the block.
Variables that were localized inside pod block...
...and to the end of consequent blocks with the same name.
But no longer.
>>> no strict 'vars'
>>> $foo
undef
|
Tests are being run in the package namespace, so you can easily call subs.
Changing result doesn't break testing
>>> my $a = [1, 2, 3]
>>> $a
[1, 2, 3]
>>> push ( @$a , 4)
>>> $a
[1, 2, 3, 4]
|