
% equality testing made easy
\ProvidesPackage{cxltx-style-equals}

% ==========================================================================================================
%
% ----------------------------------------------------------------------------------------------------------
\usepackage{etoolbox}

% ----------------------------------------------------------------------------------------------------------
\newcommand{\eqTextEquals}[4]{%
  % ........................................................................................................
  \ifdefmacro{#1}{% #1 is a macro
    \ifdefmacro{#2}{% #1 and #2 are macros
        \ifdefstrequal{#1}{#2}{#3}{#4}%
      }{% #1 is a macro, #2 is a literal
        \ifdefstring{#1}{#2}{#3}{#4}%
      }%
  % ........................................................................................................
  }{% #1 is a literal
    \ifdefmacro{#2}{% #1 is a literal, #2 is a macro
        \ifdefstring{#2}{#1}{#3}{#4}%
      }{% #1 and #2 are literals
        \ifstrequal{#1}{#2}{#3}{#4}%
      }%
    }%
  }%

% ----------------------------------------------------------------------------------------------------------
\newcommand{\eqIfTextEqualsThen}[3]{%
  \eqTextEquals{#1}{#2}{#3}{}%
  }%

% ----------------------------------------------------------------------------------------------------------
\newcommand{\eqUnlessTextEqualsThen}[3]{%
  \eqTextEquals{#1}{#2}{}{#3}%
  }%

