function perm_lex_unrank_test ( )

%*****************************************************************************80
%
%% perm_lex_unrank_test() tests perm_lex_unrank().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    23 December 2015
%
%  Author:
%
%    John Burkardt
%
  n = 4;

  fprintf ( 1, '\n' );
  fprintf ( 1, 'perm_lex_unrank_test():\n' );
  fprintf ( 1, '  perm_lex_unrank() unranks\n' );
  fprintf ( 1, '  permutations using the lexicographic ordering:\n' );

  rank = 12;

  p = perm_lex_unrank ( rank, n );

  perm_print ( n, p, '  The element of rank 12:' );

  return
end
