add tests and fix __rvm_version_compare, update #1691