function upc_is_valid_test ( )

%*****************************************************************************80
%
%% upc_is_valid_test() tests upc_is_valid().
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    08 September 2015
%
%  Author:
%
%    John Burkardt
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'UPC_IS_VALID_TEST\n' );
  fprintf ( 1, '  UPC_IS_VALID reports whether a UPC is valid.\n' );
  fprintf ( 1, '\n' );
%
%  Supply a valid code UPC code, with dashes.
%
  s1 = '6-39382-00039-3';
  value1 = 1;
  value2 = upc_is_valid ( s1 );
  fprintf ( 1, '  Validity of "%s" is %d, expecting %d\n', s1, value2, value1 );
%
%  Modify one digit.
%
  s1 = '6-39352-00039-3';
  value1 = 0;
  value2 = upc_is_valid ( s1 );
  fprintf ( 1, '  Validity of "%s" is %d, expecting %d\n', s1, value2, value1 );
%
%  Supply a valid UPC code, with spaces.
%
  s1 = '0 43000 18170 6';
  value1 = 1;
  value2 = upc_is_valid ( s1 );
  fprintf ( 1, '  Validity of "%s" is %d, expecting %d\n', s1, value2, value1 );
%
%  Modify the check digit.
%
  s1 = '0 43000 18170 9';
  value1 = 0;
  value2 = upc_is_valid ( s1 );
  fprintf ( 1, '  Validity of "%s" is %d, expecting %d\n', s1, value2, value1 );

  return
end
