# Testing that a sample corresponds to an arbitrary distribution

I'm writing a set of unit test for a function that draws random numbers from an arbitrary distribution, defined as a PDF (example of such a function can be seen here). I am confused about the proper way of obtaining a good confidence that the function output indeed follows that specified distribution.

I know that proving equality is much harder that disproving it, but good approximation will do.

An answer on this site suggests using Pearson's chi-squared test for similar purposes in the case of discrete variable. Here, I'm dealing with continuous variable, for which the PDF is defined using paired vectors $X$ and $P$ of final sizes.