function luhn_check_digit_calculate_test ( )

%*****************************************************************************80
%
%% luhn_check_digit_calculate_test() tests luhn_check_digit_calculate().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    04 October 2015
%
%  Author:
%
%    John Burkardt
% 
  fprintf ( 1, '\n' );
  fprintf ( 1, 'luhn_check_digit_calculate_test():\n' );
  fprintf ( 1, '  LUHN_CHECK_DIGIT_CALCULATE calculates the check digit\n' );
  fprintf ( 1, '  for a string of digits\n' );
  fprintf ( 1, '\n' );

  s1 = '7992739871';
  d1 = 3;
  d2 = luhn_check_digit_calculate ( s1 );
  fprintf ( 1, '  Check digit of "%s" is %d, expecting %d\n', s1, d2, d1 );

  s1 = '9876234510';
  d1 = 0;
  d2 = luhn_check_digit_calculate ( s1 );
  fprintf ( 1, '  Check digit of "%s" is %d, expecting %d\n', s1, d2, d1 );

  s1 = '246897531';
  d1 = 9;
  d2 = luhn_check_digit_calculate ( s1 );
  fprintf ( 1, '  Check digit of "%s" is %d, expecting %d\n', s1, d2, d1 );

  s1 = '135798642';
  d1 = 9;
  d2 = luhn_check_digit_calculate ( s1 );
  fprintf ( 1, '  Check digit of "%s" is %d, expecting %d\n', s1, d2, d1 );

  return
end
