--- a/tests/rtest_limit.mac
+++ b/tests/rtest_limit.mac
@@ -385,6 +385,10 @@
 /* Calculus mistake: wrong answer: limit - ID: 3534858 */
 limit((sin(x)-tan(x))/(x*(cos(x)-1)),x,0);
 1;
+
+/* #2639 limit asks about internal variable */
+limit(tan(x)/sqrt(tan(x)^2+1),x,%pi/2,plus);
+-1;
 
 limit(1/psi[1](x), x, inf);
 inf;