Check this directory out and look at the code in the *.t files.:
http://cpansearch.perl.org/src/MAKAMAKA/Text-CSV-1.32/t/
(The version number -1.32 might change eventually so the link might become "dead". Increment the version number yourself by trial-and-error, or go to the parent directory or click here
https://metacpan.org/pod/Text::CSV
and click through via "Browse" to the source code of the newest version)
Text::CSV_XS is a mature perl module for parsing csv files. The *.t files are written in Perl 5, they contain lots of testcases for self-testing the module, they are to be performed at module installation time.