Re: [tap] More uncertainty about junk lines

Andrew Rodland <andrew@cleverdomain.org> Fri, 24 June 2011 13:52 UTC

Return-Path: <andrew@cleverdomain.org>
X-Original-To: tap@ietfa.amsl.com
Delivered-To: tap@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BBE0921F8470 for <tap@ietfa.amsl.com>; Fri, 24 Jun 2011 06:52:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.976
X-Spam-Level:
X-Spam-Status: No, score=-1.976 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id TSOCFJXmQ8WJ for <tap@ietfa.amsl.com>; Fri, 24 Jun 2011 06:52:20 -0700 (PDT)
Received: from smtp.pobox.com (b-pb-sasl-quonix.pobox.com [208.72.237.35]) by ietfa.amsl.com (Postfix) with ESMTP id D752521F846F for <tap@ietf.org>; Fri, 24 Jun 2011 06:52:18 -0700 (PDT)
Received: from smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 755CF2A2F for <tap@ietf.org>; Fri, 24 Jun 2011 09:52:17 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=mime-version :in-reply-to:references:date:message-id:subject:from:to:cc :content-type; s=sasl; bh=Ps19+f1CS73tDulteXNdhGVDTJo=; b=PcDKZB VEfKP/ZPcibSqOCRfny4DI822Qsz3azati9TzAparyXsuYeDUSZAuxMq8isIpY1j ONmo/OiW5FKwRGlnxA6+Ppx5fhs7IJ3hXzV8xNq+YLXXjLJbsHtX1d4vjJFJPe/b UhZGOQhNZ0Q76oL6h5leCvz8RRglemFQGClS0=
Received: from b-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 6A67F2A2D for <tap@ietf.org>; Fri, 24 Jun 2011 09:52:17 -0400 (EDT)
Received: from mail-wy0-f172.google.com (unknown [74.125.82.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by b-sasl-quonix.pobox.com (Postfix) with ESMTPSA id EFB7C2A28 for <tap@ietf.org>; Fri, 24 Jun 2011 09:52:16 -0400 (EDT)
Received: by wyj26 with SMTP id 26so2197029wyj.31 for <tap@ietf.org>; Fri, 24 Jun 2011 06:52:16 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.133.210 with SMTP id q60mr727426wei.1.1308923536042; Fri, 24 Jun 2011 06:52:16 -0700 (PDT)
Received: by 10.216.89.134 with HTTP; Fri, 24 Jun 2011 06:52:16 -0700 (PDT)
In-Reply-To: <818669.75391.qm@web65712.mail.ac4.yahoo.com>
References: <BANLkTimKuaF3g_40Bvgs09Pvdj5_7FZ3BQ@mail.gmail.com> <818669.75391.qm@web65712.mail.ac4.yahoo.com>
Date: Fri, 24 Jun 2011 09:52:16 -0400
Message-ID: <BANLkTik6fWCDfiOqKRKf8S6TsQfMRMEyiA@mail.gmail.com>
From: Andrew Rodland <andrew@cleverdomain.org>
To: Ovid <curtis_ovid_poe@yahoo.com>
Content-Type: multipart/alternative; boundary=0016e6dede03676ba004a6758277
X-Pobox-Relay-ID: 2C2977EE-9E69-11E0-B196-91CE2E706CDE-16769786!b-pb-sasl-quonix.pobox.com
Cc: "tap-l@testanything.org" <tap-l@testanything.org>, "tap@ietf.org" <tap@ietf.org>
Subject: Re: [tap] More uncertainty about junk lines
X-BeenThere: tap@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Test Anything Protocol WG discussions <tap.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/tap>, <mailto:tap-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tap>
List-Post: <mailto:tap@ietf.org>
List-Help: <mailto:tap-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tap>, <mailto:tap-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 24 Jun 2011 13:52:20 -0000

On Fri, Jun 24, 2011 at 9:20 AM, Ovid <curtis_ovid_poe@yahoo.com> wrote:

> >________________________________
> >From: Andrew Rodland <andrew@cleverdomain.org>
> >To: "tap-l@testanything.org" <tap-l@testanything.org>rg>; "tap@ietf.org" <
> tap@ietf.org>
> >Sent: Friday, 24 June 2011, 15:08
> >Subject: [tap] More uncertainty about junk lines
> >
> >
> >Once again I'm working on my parser and trying to deal with some
> ambiguities, and I'm realizing that I may be mistaken about the handling of
> junk lines. What does "any line that does not parse must be ignored" in the
> draft spec really mean? Does it mean lines that couldn't possibly be TAP in
> any position (in which case we can still throw an error on out-of-sequence
> TAP) or does it mean any line that can't parse in *this* position, in which
> case there are no true parse errors at all? In other words, is this TAP:
> >1..3
> >ok 1
> >ok 2
> >1..1
> >ok 3
> >valid with an ignored fourth line, or does it have an error on the fourth
> line?
>
>
> That's a very annoying edge case you have there, but I would argue that
> anything which *could* be parsed as a TAP line MUST be parsed as such, thus
> rendering the above invalid. Otherwise, we'd have no idea if you were
> spitting out bad TAP or something else was spitting out junk which happened
> to look like TAP.
>
> Thus:
>
> * If something *can* be parsed as a TAP line, do so, even if it renders the
> TAP document invalid.
> * If something *can't* be parsed as a TAP line, ignore it.
>

I agree entirely. I implemented the opposite behavior in TAP::Spec::Parser
and I've been uncomfortable about it ever since I have. Only allowing
"non-TAP lines" to be ignored as junk seems a lot more sane, in terms of
allowing us to reject malformed TAP and in terms of keeping parsers
manageable. I'm going to change the behavior in TAP::Spec::Parser, write a
few tests for it, and then set about clarifying the spec, maybe at YAPC.

Andrew