You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Motivation is to provide unified behaviour for another test modules (like Test::Exception) to accept different kind of expectations as well as allow new expectation mechanisms (like Test::Deep to rise and being used by existing modules.
Let support combinations of such libraries by providing Expectation base class Test::Builder::Expectation
with method expect ($got) it will compare given date with expectation, returning Result instance
should support aggregation (or even operator overloading) like Test::Deep
should support negation (eg: foo & ! bar)
'Test::Build::Expectation::Result`
with method 'ok' (and boolean overload as well)
with method diag to format diagnostic message
-- format_got to properly format given data
-- format_expect to properly format what was expected
Functions like Test::Builder::maybe_regex should return Expectation instance as well so for example (taken from Text::Exception
At this point the tools in Test::More are considered practically unchangeable (as far as interface and new features go, under the hood changes, and bugfixes can still happen). Any significant change like this has the potential to impact a LOT of things. Also it would be a nasty cycle to have Test::More in any way depend on Test::Deep, even for dev/test deps.
New features, interfaces, and support belong in new/alt libraries. Currently Test2 is the successor as far as where new ideas go to be tried. Test2-Suite is the package you are looking for. That said Test2::Suite has it's own deep comparison tools that have a lot of overlap with Test::Deep. Maybe it would be a good idea to make Test::Deep and Test2::Tools::Compare (part of Test2-Suite) support eachothers 'expected' structures.
Inspiration: Test-More/test-exception#16
Motivation is to provide unified behaviour for another test modules (like
Test::Exception
) to accept different kind of expectations as well as allow new expectation mechanisms (likeTest::Deep
to rise and being used by existing modules.Let support combinations of such libraries by providing Expectation base class
Test::Builder::Expectation
expect ($got)
it will compare given date with expectation, returningResult
instanceTest::Deep
foo & ! bar
)'Test::Build::Expectation::Result`
diag
to format diagnostic message--
format_got
to properly format given data--
format_expect
to properly format what was expectedFunctions like
Test::Builder::maybe_regex
should return Expectation instance as well so for example (taken fromText::Exception
will be written as
With such layout (and similar support by
Test::Deep
) mentioned pull request will not be necessary.The text was updated successfully, but these errors were encountered: