Add unit tests for pure functions