Add tests for stack functions