\pdfoutput=1
\documentclass[12pt]{amsart}
\usepackage{boolexpr}
\def \p{1}
\def \q{1}
\begin{document}
\switch[\p=]
\case{\q}abc
\endswitch
def
\end{document}
Compiling the above I get the following error
! Missing number, treated as zero.
<to be read again>
\bex@=0 truepart
l.12 \endswitch
But if we change the definition to
\def \q{2}
or change the line to
\switch[1=]
it will be OK. But only change the line to
\case{1}abc
yields the same error.
Any idea why this happens? Thank you in advance.

boolexpr. I suggest you report it to the package author. – Joseph Wright♦ Dec 29 '11 at 9:46