On Sun, 01 Oct 2017 10:10:55 -0700, tbrowder wrote:
> The purpose of the second description would be for use if a test
> fails. For example we look at the current output of a successful test
> of a module’s META6.json file:
>
> t/000-meta-test.t ..
> 1..1
> ok 1 - have a META file
> ok 2 - META parses okay
> ok 3 - have all required entries
> ok 4 - 'provides' looks sane
> ok 5 - Optional 'authors' and not 'author'
> ok 6 - License is correct
> ok 7 - name has a hypen rather than '::' (if this is intentional
> please pass :relaxed-name to meta-ok)
> ok 8 - no 'v' in version strings (meta-version greater than 0)
> ok 9 - version is present and doesn't have an asterisk
> ok 10 - have usable source
> 1..10
> ok 1 - Project META file is good
>
> Look particularly at the 7th sub-test results line:
>
> ok 7 - name has a hyphen rather than '::' (if this is intentional
> please pass :relaxed-name to meta-ok)
>
> To me a **successful** test result description would say something
> like:
>
> ok 7 - name does not contain a hyphen
>
> and an **unsuccessful** test would use something like the original
> single description:
>
> not ok 7 - name has a hyphen rather than '::' (if this is
> intentional please pass :relaxed-name to meta-ok)
>
> So the test entry in module Test::META file Test/META.pm that
> currently reads:
>
> ok check-name($meta, :$relaxed-name), \
> "name has a hyphen rather than '::' (if this is intentional
> please pass :relaxed-name to meta-ok)";
>
> could read something like:
>
> ok check-name($meta, :$relaxed-name), \
> "name does not contain a hyphen", \
> :desc-fail("name has a hyphen rather than '::' (if this is
> intentional please pass :relaxed-name to meta-ok))";
Thank you for the report.
My vote on this feature is a most definite -1. I see no reason to over-engineer
a core module to support some fringe usecase.
The tests routines return the test status, so you can write that particular
usecase as:
ok check-name($meta, :$relaxed-name), "name has a hyphen rather than '::'"
or diag "\nTo use hyphen in name, pass :relaxed-name to meta-ok\n";
Which comes out as:
not ok 1 - name has a hyphen rather than '::'
# Failed test 'name has a hyphen rather than '::''
# at /tmp/z.p6 line 4
#
# To use hyphen in name, pass :relaxed-name to meta-ok
#
ZZ