more unit tests for trail functions