test cwd reimplementation