tinyyarn

scenario testing of Unix command line tools
Log | Files | Refs | README | LICENSE

commit d8d64ceff29e74f7839b2ad1767c1aeedb803d38
parent 6c6c7a4b6305e34d4c7db6d601705ee20ff0e9cb
Author: Richard Ipsum <richardipsum@fastmail.co.uk>
Date:   Sun,  3 Mar 2019 12:50:32 +0000

Check for duplicate scenarios

Diffstat:
Mtyarn.in | 10++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)

diff --git a/tyarn.in b/tyarn.in @@ -424,6 +424,16 @@ if parsed_args["debug"] or DEBUG then end scenario_list, scenarios = parse_scenarios(parsed_args[1]) +seen = {} +for _, scenario_name in ipairs(scenario_list) do + if seen[scenario_name] then + io.stderr:write(string.format("Duplicate scenario: '%s'\n", scenario_name)) + os.exit(1) + end + + seen[scenario_name] = true +end + implementations = parse_implementations(parsed_args[2]) for _, scenario_name in ipairs(scenario_list) do