function part_successor_test ( )

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

  fprintf ( 1, ' \n' );
  fprintf ( 1, 'PART_SUCCESSOR_TEST\n' );
  fprintf ( 1, '  PART_SUCCESSOR produces partitions of N,\n' );
  fprintf ( 1, ' \n' );
  fprintf ( 1, '  Partitions of N = %d\n', n );
  fprintf ( 1, ' \n' );
%
%  List.
%
  npart = 0;
  t = [];
  rank = -1;

  while ( 1 )

    rank_old = rank;

    [ npart, t, rank ] = part_successor ( n, npart, t, rank );

    if ( rank <= rank_old )
      break
    end

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

  end

  return
end
