pathname: remove unused return values

Return value was used only by one test, rewrote test to know expected value.