add various tests, many thanks to Benoit.