From a75d447e10bb7842cdbed0bb494697ddd88fd455 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 21 Feb 2024 01:23:59 -0300 Subject: fix: handle error if test.command is not a string. Fixes #1055. --- spec/quick/test.q | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 spec/quick/test.q (limited to 'spec') diff --git a/spec/quick/test.q b/spec/quick/test.q new file mode 100644 index 00000000..cb5ccd79 --- /dev/null +++ b/spec/quick/test.q @@ -0,0 +1,51 @@ +================================================================================ +TEST: luarocks test: handle if test.command is not a string + +Regression test for #1055. + +FILE: example-1.0-1.rockspec +-------------------------------------------------------------------------------- +rockspec_format = "3.0" +source = { + url = "", +} +package = "example" +version = "1.0-1" +test = { + type = "command", + command = {"./unit.lua"}, +} +-------------------------------------------------------------------------------- + +RUN: luarocks test +EXIT: 1 +STDERR: +-------------------------------------------------------------------------------- +'command' expects a string +-------------------------------------------------------------------------------- + + + +================================================================================ +TEST: luarocks test: handle if test.script is not a string + +FILE: example-1.0-1.rockspec +-------------------------------------------------------------------------------- +rockspec_format = "3.0" +source = { + url = "", +} +package = "example" +version = "1.0-1" +test = { + type = "command", + script = {"./unit.lua"}, +} +-------------------------------------------------------------------------------- + +RUN: luarocks test +EXIT: 1 +STDERR: +-------------------------------------------------------------------------------- +'script' expects a string +-------------------------------------------------------------------------------- -- cgit v1.2.3-55-g6feb