function rgf_successor_test ( )

%*****************************************************************************80
%
%% RGF_SUCCESSOR_TEST tests RGF_SUCCESSOR.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL license.
%
%  Modified:
%
%    23 December 2015
%
%  Author:
%
%    John Burkardt
%
  m = 4;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'RGF_SUCCESSOR_TEST\n' );
  fprintf ( 1, '  RGF_SUCCESSOR lists restricted growth functions.\n' );

  f = [];
  rank = -1;

  while ( 1 )

    rank_old = rank;

    [ f, rank ] = rgf_successor ( m, f, rank );

    if ( rank <= rank_old )
      break
    end

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

  end

  return
end
