I am trying to parse the file extension of a user-given path in expl3. I have got the file extension, but I can not manage to compare it to the expected file extension. My MWE is
\documentclass[]{article}
\usepackage{expl3}
\usepackage{xparse}
\ExplSyntaxOn
\ior_new:N \g_slo_input_stream_ior
\tl_new:N \l_slo_input_dir_tl
\tl_new:N \l_slo_input_base_tl
\tl_new:N \l_slo_input_ext_tl
\cs_generate_variant:Nn \tl_if_eq:nnTF { V }
\cs_new:Nn \slo_open_file:n {
\file_parse_full_name:nNNN { #1 } \l_slo_input_dir_tl \l_slo_input_base_tl \l_slo_input_ext_tl
\tl_if_eq:VnTF \l_slo_input_ext_tl { .abc } {
#1~is~.abc-file.
} {
#1~is~\l_slo_input_ext_tl-file,~expected~.abc-file.
}
}
\NewDocumentCommand { \abcfile } { m } { \slo_open_file:n { #1 } }
\ExplSyntaxOff
\begin{document}
\abcfile{example.test} \par
\abcfile{filename.abc}
\end{document}
which produces
example.test is .test-file, expected .abc-file.
filename.abc is .abc-file, expected .abc-file.
while I expected
example.test is .test-file, expected .abc-file.
filename.abc is .abc-file
As far as I understand, the comparison in \tl_if_eq
fails. Why?