diff --git a/src/variable.cpp b/src/variable.cpp index d6eec9eeb3..4117c41da6 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -170,7 +170,8 @@ void Variable::set(int narg, char **arg) // doesn't matter if variable no longer exists if (strcmp(arg[1],"delete") == 0) { - if (narg != 2) error->all(FLERR,"Illegal variable command: expected 2 argument but found {}", narg); + if (narg != 2) + error->all(FLERR,"Illegal variable delete command: expected 2 arguments but found {}", narg); if (find(arg[0]) >= 0) remove(find(arg[0])); return; diff --git a/unittest/commands/test_variables.cpp b/unittest/commands/test_variables.cpp index cf124eeafd..2b1beddd48 100644 --- a/unittest/commands/test_variables.cpp +++ b/unittest/commands/test_variables.cpp @@ -197,11 +197,11 @@ TEST_F(VariableTest, CreateDelete) ASSERT_EQ(variable->internalstyle(variable->find("ten")), 1); TEST_FAILURE(".*ERROR: Illegal variable command.*", command("variable");); - TEST_FAILURE(".*ERROR: Illegal variable command.*", command("variable dummy index");); - TEST_FAILURE(".*ERROR: Illegal variable command.*", command("variable dummy delete xxx");); - TEST_FAILURE(".*ERROR: Illegal variable command.*", command("variable dummy loop -1");); - TEST_FAILURE(".*ERROR: Illegal variable command.*", command("variable dummy loop 10 1");); - TEST_FAILURE(".*ERROR: Illegal variable command.*", command("variable dummy xxxx");); + TEST_FAILURE(".*ERROR: Illegal variable index command.*", command("variable dummy index");); + TEST_FAILURE(".*ERROR: Illegal variable delete command: expected 2 arguments but found 3.*", command("variable dummy delete xxx");); + TEST_FAILURE(".*ERROR: Invalid variable loop argument: -1.*", command("variable dummy loop -1");); + TEST_FAILURE(".*ERROR: Illegal variable loop command.*", command("variable dummy loop 10 1");); + TEST_FAILURE(".*ERROR: Unknown variable keyword: xxx.*", command("variable dummy xxxx");); TEST_FAILURE(".*ERROR: Cannot redefine variable as a different style.*", command("variable two string xxx");); TEST_FAILURE(".*ERROR: Cannot redefine variable as a different style.*",