function partn_successor_test ( )

%*****************************************************************************80
%
%% PARTN_SUCCESSOR_TEST tests PARTN_SUCCESSOR.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    23 December 2015
%
%  Author:
%
%    John Burkardt
%
  n = 11;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'PARTN_SUCCESSOR_TEST\n' );
  fprintf ( 1, '  PARTN_SUCCESSOR lists partitions of N with maximum element NMAX.\n' );

  nmax = 4;
%
%  List.
%
  npart = 0;
  t = [];
  rank = -1;

  while ( 1 )

    rank_old = rank;

    [ npart, t, rank ] = partn_successor ( n, nmax, npart, t, rank );

    if ( rank <= rank_old )
      break
    end

    fprintf ( 1, '  %4d  ', rank );
    for i = 1 : npart
      fprintf ( 1, '%5d', t(i) );
    end
    fprintf ( 1, '\n' );

  end

  return
end
