function subset_colex_successor_test ( )

%*****************************************************************************80
%
%% subset_colex_successor_test() tests subset_colex_successor().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    22 December 2015
%
%  Author:
%
%    John Burkardt
%
  n = 5;

  fprintf ( 1, ' \n' );
  fprintf ( 1, 'subset_colex_successor_test():\n' );
  fprintf ( 1, '  subset_colex_successor() lists subsets of a set,\n' );
  fprintf ( 1, '  using the colexicographic ordering.\n' );

  t = [];
  rank = -1;

  while ( true )

    rank_old = rank;

    [ t, rank ] = subset_colex_successor ( n, t, rank );

    if ( rank <= rank_old )
      break
    end

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

  end

  return
end
