test: Print the correct operator on error

This commit is contained in:
implicitfield 2022-09-30 21:09:29 +03:00 committed by Andreas Kling
commit caab6ac968
Notes: sideshowbarker 2024-07-17 08:35:21 +09:00

View file

@ -390,7 +390,9 @@ static OwnPtr<Condition> parse_simple_expression(char* argv[])
case 'N':
case 'O':
case 's':
fatal_error("Unsupported operator \033[1m%s", argv[optind]);
// 'optind' has been incremented to refer to the argument after the
// operator, while we want to print the operator itself.
fatal_error("Unsupported operator \033[1m%s", argv[optind - 1]);
default:
--optind;
break;