#!/usr/bin/perl -w use strict; use Test::More tests => 5; use MyCSV; my $old_csv = qq{5,"a, ""b""\n and c",6\n7,,8\n}; my $table = MyCSV::parse_csv( $old_csv ); my $new_csv = MyCSV::produce_csv( $table ); ok( @$table == 2 , 'correctly finds two rows' ); ok( (@{$table->[0]} == 3 and @{$table->[1]} == 3) , 'correctly finds three columns in each row' ); ok( $table->[0]->[1] eq qq{a, "b"\n and c} , 'supports parsing embedded comma, newline, quotes' ); ok( !$table->[1]->[1] , 'supports parsing NULLs' ); ok( $new_csv eq $old_csv , 'supports producing embedded comma, newline, quotes; NULLs' ); __END__