tests for terms_stats