test: fully cover the 'port' module