For newly defined data compaction codes, as well as for the traditional data compression codes, we prove an asymptotic uniformity of probabilities of codewords, a kind of the asymptotic equipartition property. On the basis of this we propose an easily applicable Neyman-Pearson test of optimality of a code with a given asymptotic level of significance $0 < \alpha < 1$. The test is based on the sample entropy of code.
94B99, 94A99, 94A24, 62B10, 94A29