[Moose-commits] r7437 - in MooseX-GlobRef-Object/trunk: .
t/tlib/MooseX/GlobRef
dexter at code2.0beta.co.uk
dexter at code2.0beta.co.uk
Fri Jan 30 21:58:45 GMT 2009
Author: dexter
Date: 2009-01-30 13:58:44 -0800 (Fri, 30 Jan 2009)
New Revision: 7437
Removed:
MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectImmutableWithScalarSlotTest.pm
MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectWithScalarSlotTest.pm
Modified:
MooseX-GlobRef-Object/trunk/MANIFEST
MooseX-GlobRef-Object/trunk/MANIFEST.SKIP
MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectImmutableTest.pm
MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectTest.pm
MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectTestSuite.pm
Log:
* Remove unnecessary test units.
Modified: MooseX-GlobRef-Object/trunk/MANIFEST
===================================================================
--- MooseX-GlobRef-Object/trunk/MANIFEST 2009-01-30 21:32:49 UTC (rev 7436)
+++ MooseX-GlobRef-Object/trunk/MANIFEST 2009-01-30 21:58:44 UTC (rev 7437)
@@ -2,14 +2,20 @@
Changes
eg/extends_object.pl
eg/use_metaclass.pl
+Incompatibilities
lib/MooseX/GlobRef/Meta/Class.pm
lib/MooseX/GlobRef/Meta/Instance.pm
lib/MooseX/GlobRef/Object.pm
+LICENSE
+Makefile.PL
MANIFEST
MANIFEST.SKIP
+META.yml
+README
t/010_extends_object.t
t/020_metaclass.t
t/030_metaclass_instance.t
+t/test.pl
t/tlib/MooseX/GlobRef/Meta/ClassImmutableTest.pm
t/tlib/MooseX/GlobRef/Meta/ClassTest.pm
t/tlib/MooseX/GlobRef/Meta/ClassTestSuite.pm
@@ -30,7 +36,3 @@
xt/pod_coverage.t
xt/pod_spell.xt
xt/pod_syntax.t
-Makefile.PL
-README
-META.yml
-LICENSE
Modified: MooseX-GlobRef-Object/trunk/MANIFEST.SKIP
===================================================================
--- MooseX-GlobRef-Object/trunk/MANIFEST.SKIP 2009-01-30 21:32:49 UTC (rev 7436)
+++ MooseX-GlobRef-Object/trunk/MANIFEST.SKIP 2009-01-30 21:58:44 UTC (rev 7437)
@@ -4,6 +4,8 @@
,v$
\B\.svn\b
\B\.cvsignore$
+\B\.git\b
+\B\.gitignore$
# Avoid Makemaker generated and utility files.
\bMakefile$
@@ -19,6 +21,7 @@
# Avoid Devel::Cover generated files
\bcover_db
+\btmon.out$
# Avoid temp and backup files.
~$
@@ -28,16 +31,25 @@
\#$
\.#
\.rej$
+\.diff$
# Avoid OS-specific files/dirs
# Mac OSX metadata
\B\.DS_Store
# Mac OSX SMB mount metadata files
\B\._
+
# Avoid archives of this distribution
\.gz$
\.ppd$
+\.ppmx$
\.tgz$
\.deb$
\bDebian_CPANTS.txt$
-\bMooseX-GlobRef-Object-
+
+# Avoid Eclipse files
+.includepath
+.project
+
+# Avoid distdir
+\d+\.\d+\b
Modified: MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectImmutableTest.pm
===================================================================
--- MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectImmutableTest.pm 2009-01-30 21:32:49 UTC (rev 7436)
+++ MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectImmutableTest.pm 2009-01-30 21:58:44 UTC (rev 7437)
@@ -26,6 +26,16 @@
is => 'rw',
);
+ sub new {
+ my $class = shift;
+ my $self = $class->SUPER::new(@_);
+ my $scalarref = ${*$self};
+ $$scalarref = 'SCALAR';
+ my $arrayref = \@{*$self};
+ @$arrayref = ('ARRAY');
+ return $self;
+ };
+
__PACKAGE__->meta->make_immutable;
};
Deleted: MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectImmutableWithScalarSlotTest.pm
===================================================================
--- MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectImmutableWithScalarSlotTest.pm 2009-01-30 21:32:49 UTC (rev 7436)
+++ MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectImmutableWithScalarSlotTest.pm 2009-01-30 21:58:44 UTC (rev 7437)
@@ -1,126 +0,0 @@
-package MooseX::GlobRef::ObjectImmutableWithScalarTest;
-
-use Test::Unit::Lite;
-use parent 'Test::Unit::TestCase';
-
-use Test::Assert ':all';
-
-use Scalar::Util 'reftype';
-
-
-{
- package MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1;
-
- use Moose;
-
- extends 'MooseX::GlobRef::Object';
-
- has field => (
- is => 'rw',
- clearer => 'clear_field',
- default => 'default',
- lazy => 1,
- );
-
- has weak_field => (
- is => 'rw',
- );
-
- sub new {
- my $class = shift;
- my $self = $class->SUPER::new(@_);
- my $scalarref = ${*$self};
- ${$scalarref} = 'SCALAR';
- return $self;
- };
-
- __PACKAGE__->meta->make_immutable;
-};
-
-
-sub test___isa {
- my $self = shift;
- my $obj = MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1->new;
- assert_not_null($obj);
- assert_true($obj->isa('MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1'));
- assert_equals('GLOB', reftype($obj));
-};
-
-sub test_accessor {
- my $self = shift;
- my $obj = MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1->new;
- assert_not_null($obj);
- assert_true($obj->isa('MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1'));
- assert_equals('default', $obj->field);
- assert_equals(1, $obj->field(1));
- assert_equals(1, $obj->field);
- assert_true($obj->clear_field);
- assert_equals('default', $obj->field);
-};
-
-sub test_slot_moc {
- my $self = shift;
- my $mi = MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1->meta->get_meta_instance;
- assert_not_null($mi);
-
- my $obj = $mi->create_instance;
- assert_not_null($obj);
- assert_true($obj->isa('MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1'));
- assert_null($mi->get_slot_value($obj, 'field'));
- assert_true(! $mi->is_slot_initialized($obj, 'field'));
- assert_equals(1, $mi->set_slot_value($obj, 'field', 1));
- assert_equals(1, $mi->get_slot_value($obj, 'field'));
- assert_true($mi->is_slot_initialized($obj, 'field'));
- assert_true($mi->deinitialize_slot($obj, 'field'));
- assert_null($mi->get_slot_value($obj, 'field'));
- assert_true(! $mi->is_slot_initialized($obj, 'field'));
-};
-
-sub test_slot_moc_inline {
- my $self = shift;
- my $mi = MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1->meta->get_meta_instance;
- assert_not_null($mi);
-
- my $code_create_instance = $mi->inline_create_instance('$class');
- assert_not_equals('', $code_create_instance);
- my $code_get_slot_value = $mi->inline_get_slot_value('$obj', 'field');
- assert_not_equals('', $code_get_slot_value);
- my $code_is_slot_initialized = $mi->inline_is_slot_initialized('$obj', 'field');
- assert_not_equals('', $code_is_slot_initialized);
- my $code_set_slot_value = $mi->inline_set_slot_value('$obj', 'field', '$value');
- assert_not_equals('', $code_set_slot_value);
- my $code_deinitialize_slot = $mi->inline_deinitialize_slot('$obj', 'field');
- assert_not_equals('', $code_deinitialize_slot);
-
- my $obj = eval "my \$class = 'MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1'; $code_create_instance;";
- assert_not_null($obj);
- assert_true($obj->isa('MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1'));
- assert_null(eval $code_get_slot_value);
- assert_true(! eval $code_is_slot_initialized);
- assert_equals(1, eval "my \$value = 1; $code_set_slot_value;");
- assert_equals(1, eval $code_get_slot_value);
- assert_true(eval $code_is_slot_initialized);
- assert_true(eval $code_deinitialize_slot);
- assert_null(eval $code_get_slot_value);
- assert_true(! eval $code_is_slot_initialized);
-};
-
-sub test_weak_field {
- my $self = shift;
- my $mi = MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1->meta->get_meta_instance;
- assert_not_null($mi);
- my $obj = MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1->new;
- assert_not_null($obj);
- assert_true($obj->isa('MooseX::GlobRef::ObjectImmutableWithScalarTest::Test1'));
- assert_null($obj->weak_field);
- {
- my $scalar = 'SCALAR';
- assert_not_null($obj->weak_field(\$scalar));
- assert_not_null($obj->weak_field);
- assert_equals('SCALAR', ${$obj->weak_field});
- $mi->weaken_slot_value($obj, 'weak_field');
- };
- assert_null($obj->weak_field);
-};
-
-1;
Modified: MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectTest.pm
===================================================================
--- MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectTest.pm 2009-01-30 21:32:49 UTC (rev 7436)
+++ MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectTest.pm 2009-01-30 21:58:44 UTC (rev 7437)
@@ -25,6 +25,16 @@
has weak_field => (
is => 'rw',
);
+
+ sub new {
+ my $class = shift;
+ my $self = $class->SUPER::new(@_);
+ my $scalarref = ${*$self};
+ $$scalarref = 'SCALAR';
+ my $arrayref = \@{*$self};
+ @$arrayref = ('ARRAY');
+ return $self;
+ };
};
Modified: MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectTestSuite.pm
===================================================================
--- MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectTestSuite.pm 2009-01-30 21:32:49 UTC (rev 7436)
+++ MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectTestSuite.pm 2009-01-30 21:58:44 UTC (rev 7437)
@@ -8,8 +8,6 @@
my $suite = Test::Unit::TestSuite->empty_new('ExtendsObject');
$suite->add_test('MooseX::GlobRef::ObjectTest');
$suite->add_test('MooseX::GlobRef::ObjectImmutableTest');
- $suite->add_test('MooseX::GlobRef::ObjectWithScalarSlotTest');
- $suite->add_test('MooseX::GlobRef::ObjectImmutableWithScalarSlotTest');
return $suite;
};
Deleted: MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectWithScalarSlotTest.pm
===================================================================
--- MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectWithScalarSlotTest.pm 2009-01-30 21:32:49 UTC (rev 7436)
+++ MooseX-GlobRef-Object/trunk/t/tlib/MooseX/GlobRef/ObjectWithScalarSlotTest.pm 2009-01-30 21:58:44 UTC (rev 7437)
@@ -1,124 +0,0 @@
-package MooseX::GlobRef::ObjectWithScalarSlotTest;
-
-use Test::Unit::Lite;
-use parent 'Test::Unit::TestCase';
-
-use Test::Assert ':all';
-
-use Scalar::Util 'reftype';
-
-
-{
- package MooseX::GlobRef::ObjectWithScalarSlotTest::Test1;
-
- use Moose;
-
- extends 'MooseX::GlobRef::Object';
-
- has field => (
- is => 'rw',
- clearer => 'clear_field',
- default => 'default',
- lazy => 1,
- );
-
- has weak_field => (
- is => 'rw',
- );
-
- sub new {
- my $class = shift;
- my $self = $class->SUPER::new(@_);
- my $scalarref = ${*$self};
- ${$scalarref} = 'SCALAR';
- return $self;
- };
-};
-
-
-sub test___isa {
- my $self = shift;
- my $obj = MooseX::GlobRef::ObjectWithScalarSlotTest::Test1->new;
- assert_not_null($obj);
- assert_true($obj->isa('MooseX::GlobRef::ObjectWithScalarSlotTest::Test1'));
- assert_equals('GLOB', reftype($obj));
-};
-
-sub test_accessor {
- my $self = shift;
- my $obj = MooseX::GlobRef::ObjectWithScalarSlotTest::Test1->new;
- assert_not_null($obj);
- assert_true($obj->isa('MooseX::GlobRef::ObjectWithScalarSlotTest::Test1'));
- assert_equals('default', $obj->field);
- assert_equals(1, $obj->field(1));
- assert_equals(1, $obj->field);
- assert_true($obj->clear_field);
- assert_equals('default', $obj->field);
-};
-
-sub test_slot_moc {
- my $self = shift;
- my $mi = MooseX::GlobRef::ObjectWithScalarSlotTest::Test1->meta->get_meta_instance;
- assert_not_null($mi);
-
- my $obj = $mi->create_instance;
- assert_not_null($obj);
- assert_true($obj->isa('MooseX::GlobRef::ObjectWithScalarSlotTest::Test1'));
- assert_null($mi->get_slot_value($obj, 'field'));
- assert_true(! $mi->is_slot_initialized($obj, 'field'));
- assert_equals(1, $mi->set_slot_value($obj, 'field', 1));
- assert_equals(1, $mi->get_slot_value($obj, 'field'));
- assert_true($mi->is_slot_initialized($obj, 'field'));
- assert_true($mi->deinitialize_slot($obj, 'field'));
- assert_null($mi->get_slot_value($obj, 'field'));
- assert_true(! $mi->is_slot_initialized($obj, 'field'));
-};
-
-sub test_slot_moc_inline {
- my $self = shift;
- my $mi = MooseX::GlobRef::ObjectWithScalarSlotTest::Test1->meta->get_meta_instance;
- assert_not_null($mi);
-
- my $code_create_instance = $mi->inline_create_instance('$class');
- assert_not_equals('', $code_create_instance);
- my $code_get_slot_value = $mi->inline_get_slot_value('$obj', 'field');
- assert_not_equals('', $code_get_slot_value);
- my $code_is_slot_initialized = $mi->inline_is_slot_initialized('$obj', 'field');
- assert_not_equals('', $code_is_slot_initialized);
- my $code_set_slot_value = $mi->inline_set_slot_value('$obj', 'field', '$value');
- assert_not_equals('', $code_set_slot_value);
- my $code_deinitialize_slot = $mi->inline_deinitialize_slot('$obj', 'field');
- assert_not_equals('', $code_deinitialize_slot);
-
- my $obj = eval "my \$class = 'MooseX::GlobRef::ObjectWithScalarSlotTest::Test1'; $code_create_instance;";
- assert_not_null($obj);
- assert_true($obj->isa('MooseX::GlobRef::ObjectWithScalarSlotTest::Test1'));
- assert_null(eval $code_get_slot_value);
- assert_true(! eval $code_is_slot_initialized);
- assert_equals(1, eval "my \$value = 1; $code_set_slot_value;");
- assert_equals(1, eval $code_get_slot_value);
- assert_true(eval $code_is_slot_initialized);
- assert_true(eval $code_deinitialize_slot);
- assert_null(eval $code_get_slot_value);
- assert_true(! eval $code_is_slot_initialized);
-};
-
-sub test_weak_field {
- my $self = shift;
- my $mi = MooseX::GlobRef::ObjectWithScalarSlotTest::Test1->meta->get_meta_instance;
- assert_not_null($mi);
- my $obj = MooseX::GlobRef::ObjectWithScalarSlotTest::Test1->new;
- assert_not_null($obj);
- assert_true($obj->isa('MooseX::GlobRef::ObjectWithScalarSlotTest::Test1'));
- assert_null($obj->weak_field);
- {
- my $scalar = 'SCALAR';
- assert_not_null($obj->weak_field(\$scalar));
- assert_not_null($obj->weak_field);
- assert_equals('SCALAR', ${$obj->weak_field});
- $mi->weaken_slot_value($obj, 'weak_field');
- };
- assert_null($obj->weak_field);
-};
-
-1;
More information about the Moose-commits
mailing list