From 779ea7c5fa084e11690c31c12625469dab1155e7 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Thu, 15 Aug 2024 17:03:43 -0400 Subject: [PATCH] require test point ID or hyphen-minus when description exists This avoids parsing ambiguity: 1..1 ok 1 is less than 2 Is "1" part of the description, or is it the test point ID? This change makes it clear that the "1" is the test point ID, and the description is "is less than 2". To force the "1" to be part of the description, that line should read: ok - 1 is less than 2 or: ok 1 1 is less than 2 or (preferred): ok 1 - 1 is less than 2 --- tap-version-14-specification.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tap-version-14-specification.md b/tap-version-14-specification.md index 5f35a6d..2767c1d 100644 --- a/tap-version-14-specification.md +++ b/tap-version-14-specification.md @@ -60,7 +60,7 @@ TAPDocument := Version Plan Body | Version Body Plan Version := "TAP version 14\n" Plan := "1.." (Number) (" # " Reason)? "\n" Body := (TestPoint | BailOut | Pragma | Comment | Anything | Empty | Subtest)* -TestPoint := ("not ")? "ok" (" " Number)? ((" -")? (" " Description) )? (" " Directive)? "\n" (YAMLBlock)? +TestPoint := ("not ")? "ok" ((" " Number (" -")? | " -") (" " Description)?)? (" " Directive)? "\n" (YAMLBlock)? Directive := " # " ("todo" | "skip") (" " Reason)? YAMLBlock := " ---\n" (YAMLLine)* " ...\n" YAMLLine := " " (YAML)* "\n"