## The gradient should be zero at the optimal point.

for m = [ 1 : 10 ]
  x = repmat([1;1], m, 1);

  msg = sprintf("extended_rosenbrock_gradient1([1;1;...]) == 0 (m = %d)", m);
  unit_test_equals(msg, 0, extended_rosenbrock_gradient1(x));
end

## It should fail with the wrong number of coordinates.
g = extended_rosenbrock_gradient1([1;2;3]);
msg = "extended_rosenbrock_gradient1 fails when length(x) is odd";
unit_test_equals(msg, true, isna(g));
