Let $\delta$ be the Dirac delta function.
Then, let $f(x)=\delta(x) $ if $ x\in (-\infty,0] $ and $f(x)=0$ if $x\in (0,\infty)$.Then $I=\int_{-\infty}^{\infty}f(x)dx=?$
Is $I=1/2$? We know $\int_{-\infty}^{\infty}\delta(x)dx=1$. But we can not say that $\delta$ is symmetric about $y-axis$. So we can not conclude that $I=1/2$. Then what will be $I$?
Since Delta is defined with $\int_{-\infty}^{\infty}$ you cannot change those limits. What you can do is construct test function as $\phi(x)=1$ if $x\in(-\infty,0]$ and $\phi(x)=0$ if $x\in(0,\infty)$ and ask what is $\int_{-\infty}^{\infty}\phi(x)\delta(x)dx$. The answer is obviously $\phi(0)=1$.