translation from js
a testing suite and the default case