[tap-l] Nested TAP
Michael Peters
mpeters at plusthree.com
Tue Apr 15 23:32:39 UTC 2008
Andy Armstrong wrote:
> That allows for
>
> 1..3
> ok 1
> begin 2
> 1..2
> not ok 1
> ok 2
> end 2
> ok 3
>
> and
>
> 1..3
> ok 1
> begin 2
> 1..2
> not ok 1
> ok 2
> end 2
> ok 3
>
> and
>
> 1..3
> ok 1
> begin 2
> 1..2
> not ok 1
> ok 2
> end 2
> not ok 2
> ok 3
>
> All are valid TAP v13. The third version is also compatible with v12
> and earlier.
++
> After a numbered nested TAP block a TAP producer may optionally emit a
> "summary result" with the same number as the block. The overall
> success of the block is (success of nested TAP AND success of summary
> result). A summary result can therefore cause an otherwise apparently
> successful nested block to fail.
++
> A small point - that gives us no less than three sites where YAML
> diagnostics scoped for the entire nested block can be situated
>
> 1..3
> ok 1
> begin 2
> TAP version 13
> ---
> yaml: 'here'
> ...
> 1..2
> not ok 1
> ok 2
> end 2
> ---
> or: 'here'
> ...
> not ok 2
> ---
> or: 'even here'
> ...
> ok 3
>
> The first of those three is probably not a problem. I guess the parser
> will have an API that treats the interior of the block as a self
> contained TAP document via which the YAML diagnostic can be reached.
> The other two are resolved either by saying they can both appear or by
> ruling that only the third location is valid I think. I vote for the
> latter.
I vote for the 2nd. It means the optional summary line comes after everything
associated with the nested TAP. So if you don't want to do it you just drop the
last line. It's not embedded in the middle of something that's considered to all
be part of the same "test". But my feelings on this matter aren't really strong.
--
Michael Peters
Plus Three, LP
More information about the tap-l
mailing list