Cygwin and simple script with if

I am having an issue with using cygwin (on Windows XP). My script errors on if -command. The script here works fine on Linux, but cygwin fails...

#!/bin/sh
if [ "$1" == "test" ] then
    echo "Test"
fi

The error -message:
./ShellTest.sh: line 4: syntax error near unexpected token `fi'
./ShellTest.sh: line 4: `fi'

Any suggestions on this...?

Remove the carriage returns from the file if you've used a windows editor:

tr -d '\r' < dosfile > unixfile
mv unixfile dosfile