function perm_check_test ( )

%*****************************************************************************80
%
%% PERM_CHECK_TEST tests PERM_CHECK.
%
%  Licensing:
%
%    This code is distributed under the GNU LGPL 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 = %2d\n', check );
    
  end

  return
end
