tests: add test cases for -P and -p options.