Add unit tests for nth-value function