Basu's lemma and goodness-of-fit tests