Avoiding regression by testing scripts automatically

Hi everyone!

I recently noticed a bug in one of the script I developed.
I would like to create some tests in order to avoid future regressions.

Has any of you tried to do such thing?