DBIx-Compare-ContentChecksum-mysql

 view release on metacpan or  search on metacpan

Makefile.PL  view on Meta::CPAN


use File::Basename;


WriteMakefile(
    NAME              => 'DBIx::Compare::ContentChecksum::mysql',
    VERSION_FROM      => 'lib/DBIx/Compare/ContentChecksum/mysql.pm',
    PREREQ_PM         => {  DBIx::Compare => 1.1,
    						DBI => 1.605,
    						DBD::mysql => 4.007,
    						Test::Differences => 0.47,
    						Test::More => 0.80,
    						Test::Group => 0.07
    					},
    ($] >= 5.005 ? 
      (AUTHOR         => 'Christopher Jones <c.jones@ucl.ac.uk>') : ()),
);

README  view on Meta::CPAN

This module requires these other modules and libraries:

  DBI
  DBD::mysql
  DBIx::Compare

The test scripts accompanying the modules require the following modules and libraries:

  Test::More
  Test::Group
  Test::Differences

COPYRIGHT AND LICENCE

Copyright (C) 2008 by Christopher Jones

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself

t/DBIx_Compare_ContentChecksum_mysql.t  view on Meta::CPAN

#! /usr/bin/perl -w

use strict;

use Test::More tests=>18;
use Test::Group;
use Test::Differences;

use DBI;

# 1
BEGIN {
	use_ok('DBIx::Compare::ContentChecksum::mysql');
}

my $user_name = 'test';
my $user_pass = '';

t/DBIx_Compare_ContentChecksum_mysql.t  view on Meta::CPAN

		# an int field
		ok(@aChecksum = $oDB_Content->field_checksum('filter','filter_id'),"field_checksum('filter','filter_id')");
		eq_or_diff \@aChecksum,['766cf85a89d87f5bca3c9b5793b456831a45ed8a388e4b644044d238cde0a9f4','766cf85a89d87f5bca3c9b5793b456831a45ed8a388e4b644044d238cde0a9f4'],'filter.filter_id checksums';

		# a varchar field
		ok(@aChecksum = $oDB_Content->field_checksum('laser','colour_name'),"field_checksum('laser','colour_name')");
		eq_or_diff \@aChecksum,['e235f3560a066a5d5bd51d2ebe81813ae18af807eb7a24cf8f796af719ddca1f','e235f3560a066a5d5bd51d2ebe81813ae18af807eb7a24cf8f796af719ddca1f'],'laser.colour_name checksums';

		# a varchar field returning NULL
		ok(@aChecksum = $oDB_Content->field_checksum('fluorochrome','manufacturer'),"field_checksum('fluorochrome','manufacturer')");
		#eq_or_diff \@aChecksum,[undef,undef],'fluorochrome.manufacturer';	# Test::Differences throws warning at this test
		is($aChecksum[0],undef,'fluorochrome.manufacturer');
		is($aChecksum[1],undef,'fluorochrome.manufacturer');
	};

	#9
	test 'the comparisons' => sub {
		cmp_ok($oDB_Content->compare_table_lists,'==',1,'compare_table_lists');
		cmp_ok($oDB_Content->compare_row_counts,'==',1,'compare_row_counts');
		cmp_ok($oDB_Content->compare_fields_checksum,'==',1,'compare_fields_checksum');
		



( run in 1.023 second using v1.01-cache-2.11-cpan-0b5f733616e )