function part_successor_test ( )

%*****************************************************************************80
%
%% part_successor_test() tests part_successor().
%
%  Licensing:
%
%    This code is distributed under the MIT 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 ( true )

    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
