%%
%% This is file `GS_set_EAN_control_digit.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% GS1.dtx  (with options: `test,GS.set.EAN.control.digit')
%% 
%% EXPERIMENTAL CODE
%% 
%% This Work depends on the correct version of expl3 release.  If
%% you'll update expl3 you may need a update of this this Work too.
%% 
%% Do not distribute this file without also distributing the
%% source files specified above.
%% 
%% Do not distribute modified version of this file.
%% 
%% File: GS1.dtx Copyright (C) 2012 Markus Kohm
%%
%% It may be distributed and/or modified under the conditions of the
%% LaTeX Project Public License (LPPL), either version 1.3c of this
%% license or (at your option) any later version.  The latest version
%% of this license is in the file
%%
%%    http://www.latex-project.org/lppl.txt
%%
%% This file is part of the "GS1 bundle" (The Work in LPPL)
%% and all files in that bundle must be distributed together.
%%
%% The released version of this bundle is available from CTAN.
%%
%% -------------------------------------------------------------------------
\RequirePackage{expl3}
\GetIdInfo$Id: GS1.dtx 15 2012-08-27 10:25:03Z mjk $
  {GS1 code handler and barcode generator}
\documentclass{article}
\usepackage{GS1}
\ExplSyntaxOn
\msg_new:nnn { GS1/test } { function }
  {
    Something~is~wrong~with~function~#1
    \msg_line_context:~~of~\c_job_name_tl.tex.
  }
\ExplSyntaxOff
\begin{document}
\ExplSyntaxOn
\seq_new:N \l_testa_seq
\GS_set_code_digit_seq:Nn \l_testa_seq {ISBN 978-3-86541-459-5}
\seq_new:N \l_testb_tl
\seq_pop_right:NN \l_testa_seq \l_testb_tl
\GS_set_EAN_control_digit:N \l_testa_seq
\tl_new:N \l_testa_tl
\seq_get_right:NN \l_testa_seq \l_testa_tl
Control~digit~should~be~ \tl_use:N \l_testb_tl {} ~
\int_compare:nNnTF { \l_testa_tl } { = } { \l_testb_tl }
  {
    ~and~is~\tl_use:N \l_testa_tl .
  }
  {
    ~but~it~\tl_use:N \t_testa_tl .
    \msg_error:nnn { GS1/test } { function } { \GS_set_EAN_control_digit:N }
  }

\ExplSyntaxOff
\end{document}
%% 
%%
%% End of file `GS_set_EAN_control_digit.tex'.
