fix less than and equal bug, add unittest