test calculate token function