function perm_check_test ( )

%*****************************************************************************80
%
%% perm_check_test() tests perm_check().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    26 December 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'perm_check test():\n' );
  fprintf ( 1, '  perm_check() checks a permutation.\n' );
  
  for test = 1 : 3

    if ( test == 1 )
      n = 5;
      s = [ 5, 1, 8, 3, 4 ];
    elseif ( test == 2 )
      n = 5;
      s = [ 5, 1, 4, 3, 4 ];
    elseif ( test == 3 )
      n = 5;
      s = [ 5, 1, 2, 3, 4 ];
    end

    check = perm_check ( n, s );
    i4vec_transpose_print ( n, s, '  Permutation:' );
    fprintf ( 1, '  Check = %5s\n', mat2str ( check ) );
    
  end

  return
end
