function r8poly_square_test ( )

%*****************************************************************************80
%
%% r8poly_square_test() tests r8poly_square().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    20 October 2019
%
%  Author:
%
%    John Burkardt
%
  ntest = 3;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'r8poly_square_test():\n' );
  fprintf ( 1, '  r8poly_square() squares a polynomial.\n' );
  fprintf ( 1, '\n' );

  for itest = 1 : ntest

    if ( itest == 1 )
      na = 1;
      a(1:na+1) = [ 1.0; 1.0 ];
    elseif ( itest == 2 )
      na = 1;
      a(1:na+1) = [ -2.0; 1.0 ];
    elseif ( itest == 3 )
      na = 2;
      a(1:na+1) = [ 3.0; 2.0; 1.0 ];
    end

    b = r8poly_square ( na, a );
    nb = 2 * na;

    r8poly_print ( a, '  The polynomial A:' );

    r8poly_print ( b, '  The polynomial A^2:' );

  end

  return
end
