function vin_test ( )

%*****************************************************************************80
%
%% vin_test() tests vin().
%
%  Licensing:
%
%    This code is distributed under the MIT license. 
%
%  Modified:
%
%    09 September 2022
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    John D Cook,
%    Vehicle Identification Number (VIN) Check Sum,
%    https://www.johndcook.com/blog/2019/09/12/vin-check-sum/
%    12 September 2019.
%
%    John D Cook,
%    Computing VIN Checksums,
%    https://www.johndcook.com/blog/2022/09/04/computing-vin-checksums/
%    09 September 2022.
%
  addpath ( '../vin' );

  timestamp ( );
  fprintf ( 1, '\n' );
  fprintf ( 1, 'vin_test():\n' );
  fprintf ( 1, '  MATLAB/Octave version %s\n', version ( ) );
  fprintf ( 1, '  vin() verifies a Vehicle Identifical Number (VIN).\n' );
  fprintf ( 1, '\n' );

  for test = 1 : 3

    if ( test == 1 )
      vin = '11111111111111111';
    elseif ( test == 2 )
      vin = '5GZCZ43D13S812715';
    else
      vin = '1M8GDM9AXKP042788';
    end

    fprintf ( 1, '"%s"', vin );
    fprintf ( 1, '  %s', checksum ( vin ) );
    fprintf ( 1, '  %s\n', mat2str ( validate ( vin ) ) );

  end
%
%  Terminate.
%
  fprintf ( 1, '\n' );
  fprintf ( 1, 'vin_test():\n' );
  fprintf ( 1, '  Normal end of execution.\n' );
  timestamp ( );
  rmpath ( '../vin' );

  return
end
function timestamp ( )

%*****************************************************************************80
%
%% timestamp() prints the current YMDHMS date as a timestamp.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 February 2003
%
%  Author:
%
%    John Burkardt
%
  t = now;
  c = datevec ( t );
  s = datestr ( c, 0 );
  fprintf ( 1, '%s\n', s );

  return
end

