> It looks like the error is shown only when the whole condition is true,
assuming that the non-number argument is evaluated as 0.
Indeed, here is what I see in grub-core/commands/test.c
426 static grub_err_t
427 grub_cmd_test (grub_command_t cmd __attribute__ ((unused)),
428 int argc, char **args)
429 {
430 int argn = 0;
431
432 if (argc >= 1 && grub_strcmp (args[argc - 1], "]") == 0)
433 argc--;
434
435 return test_parse (args, &argn, argc) ? GRUB_ERR_NONE
436 : grub_error (GRUB_ERR_TEST_FAILURE, N_("false"));
437 }
It discards any error messages in case test_parse() returns true