Ticket #1086 (new bug)

Opened 5 years ago

Last modified 3 years ago

[BUG] Test::More doesn't support plan('no_plan')

Reported by: pmichaud Owned by: chromatic
Priority: normal Milestone:
Component: testing Version: 1.6.0
Severity: medium Keywords:
Cc: Language:
Patch status: Platform: all

Description

The documentation for Test::More (runtime/parrot/library/Test/More.pir:77) says that one can specify "no_plan" as a value to the plan() function, but it doesn't appear to work:

$ cat x.t
#!./parrot

.sub 'main' :main
    load_bytecode 'Test/More.pbc'

    .local pmc exports, curr_namespace, test_namespace
    curr_namespace = get_namespace
    test_namespace = get_namespace ['Test';'More']
    exports        = split ' ', 'plan diag ok nok is todo'
    test_namespace.'export_to'(curr_namespace, exports)

    plan('no_plan')

    ok(1, 'because I said so')
.end

$ prove x.t
x.t .. All 1 subtests passed 

Test Summary Report
-------------------
x.t (Wstat: 0 Tests: 1 Failed: 0)
  Parse errors: No plan found in TAP output
Files=1, Tests=1,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.02 cusr  0.00 csys =  0.06 CPU)
Result: FAIL
$ ./parrot x.t
ok 1 - because I said so
$ 

Change History

Changed 5 years ago by dukeleto

  • platform set to all

I will look into this. I wonder if the same thing happens if you do .include 'test_more.pir' instead of loading bytecode ?

Changed 3 years ago by bacek

  • owner set to chromatic

Hello.

Just my $.02. We do have done_testing now. I think we should just remove reference to no_plan from Test::More documentation.

-- Bacek.

Note: See TracTickets for help on using tickets.