add unittest for kmp