Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Class-Moose CPAN distribution.

Report information
The Basics
Id: 87801
Status: resolved
Priority: 0/
Queue: Test-Class-Moose

People
Owner: Nobody in particular
Requestors: thomas.lokajczyk [...] gmx.de
Cc: randomcoder1 [...] gmail.com
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: exclude_tags option
Date: Mon, 12 Aug 2013 21:09:28 +0200 (CEST)
To: bug-Test-Class-Moose [...] rt.cpan.org
From: "Thomas Lokajczyk" <thomas.lokajczyk [...] gmx.de>
Hi Ovid, I am very happy with your Test::Class::Moose module, especially the tag function is very helpful in my use case. But I found a little bug with the exclude_tags option. Here my test case: package TestFor; use Test::Class::Moose; sub test_1 : Tags( ALL 001 ){ ok(1, 'Test 1') }; sub test_2 : Tags( ALL 002 ){ ok(1, 'Test 1') }; sub test_3 : Tags( ALL 003 ){ ok(1, 'Test 1') }; 1; When I start this test with use FindBin; use lib "$FindBin::Bin/lib"; use Test::Class::Moose::Load ( 'lib/TestFor.pm', ); Test::Class::Moose->new( include_tags => ['ALL'] )->runtests; Every thing works fine: C:\svn\Tools\Testbox>perl run.pl 1..1 # # Running tests for TestFor # 1..3 # TestFor->test_1() ok 1 - Test 1 1..1 ok 1 - test_1 # TestFor->test_2() ok 1 - Test 1 1..1 ok 2 - test_2 # TestFor->test_3() ok 1 - Test 1 1..1 ok 3 - test_3 ok 1 – TestFor Now I use the exclude_tags option: Test::Class::Moose->new( include_tags => ['ALL'], exclude_tags => ['001'] )->runtests; Here the result is still ok: C:\svn\Tools\Testbox>perl run.pl 1..1 # # Running tests for TestFor # 1..2 # TestFor->test_2() ok 1 - Test 1 1..1 ok 1 - test_2 # TestFor->test_3() ok 1 - Test 1 1..1 ok 2 - test_3 ok 1 – TestFor But when I use two tags to exclude it does not run as I would expect Test::Class::Moose->new( include_tags => ['ALL'], exclude_tags => ['001', '002' ] )->runtests; C:\svn\Tools\Testbox>perl run.pl 1..1 # # Running tests for TestFor # 1..3 # TestFor->test_1() ok 1 - Test 1 1..1 ok 1 - test_1 # TestFor->test_2() ok 1 - Test 1 1..1 ok 2 - test_2 # TestFor->test_3() ok 1 - Test 1 1..1 ok 3 - test_3 ok 1 – TestFor The elements in the exclude_tag array are not connected with an OR but with an AND relation as you can see here Test::Class::Moose->new( include_tags => ['ALL'], exclude_tags => ['001', 'ALL' ] )->runtests; C:\svn\Tools\Testbox>perl run.pl 1..1 # # Running tests for TestFor # 1..2 # TestFor->test_2() ok 1 - Test 1 1..1 ok 1 - test_2 # TestFor->test_3() ok 1 - Test 1 1..1 ok 2 - test_3 ok 1 - TestFor I guess this behavior is not correct. These tests where made with Test-Class-Moose-0.12 on Strawberry Perl 5.16.3.1. I hope that you are ok with my description, it is my first bug report I wrote for a CPAN module. Best regards Thomas    
Hi Thomas, Ovid, I just made a fork and used Thomas's code to create a test and then modified the code to pass the test. Essentially in my view, exclude_tags should take priority over include_tags. Please have a look. https://github.com/Ovid/test-class-moose/pull/15 Thanks, Stefan On Mon Aug 12 15:09:40 2013, thomas.lokajczyk@gmx.de wrote: Show quoted text
> Hi Ovid, > > I am very happy with your Test::Class::Moose module, especially the > tag function is very helpful in my use case. But I found a little bug > with the exclude_tags option. Here my test case: > > package TestFor; > use Test::Class::Moose; > > sub test_1 : Tags( ALL 001 ){ > ok(1, 'Test 1') > }; > > sub test_2 : Tags( ALL 002 ){ > ok(1, 'Test 1') > }; > > sub test_3 : Tags( ALL 003 ){ > ok(1, 'Test 1') > }; > > 1; > > When I start this test with > > use FindBin; > use lib "$FindBin::Bin/lib"; > use Test::Class::Moose::Load ( 'lib/TestFor.pm', ); > > Test::Class::Moose->new( include_tags => ['ALL'] )->runtests; > > Every thing works fine: > > C:\svn\Tools\Testbox>perl run.pl > 1..1 > # > # Running tests for TestFor > # > 1..3 > # TestFor->test_1() > ok 1 - Test 1 > 1..1 > ok 1 - test_1 > # TestFor->test_2() > ok 1 - Test 1 > 1..1 > ok 2 - test_2 > # TestFor->test_3() > ok 1 - Test 1 > 1..1 > ok 3 - test_3 > ok 1 – TestFor > > Now I use the exclude_tags option: > > Test::Class::Moose->new( include_tags => ['ALL'], > exclude_tags => ['001'] )->runtests; > > Here the result is still ok: > > C:\svn\Tools\Testbox>perl run.pl > 1..1 > # > # Running tests for TestFor > # > 1..2 > # TestFor->test_2() > ok 1 - Test 1 > 1..1 > ok 1 - test_2 > # TestFor->test_3() > ok 1 - Test 1 > 1..1 > ok 2 - test_3 > ok 1 – TestFor > > But when I use two tags to exclude it does not run as I would expect > > Test::Class::Moose->new( include_tags => ['ALL'], > exclude_tags => ['001', '002' ] )->runtests; > > C:\svn\Tools\Testbox>perl run.pl > 1..1 > # > # Running tests for TestFor > # > 1..3 > # TestFor->test_1() > ok 1 - Test 1 > 1..1 > ok 1 - test_1 > # TestFor->test_2() > ok 1 - Test 1 > 1..1 > ok 2 - test_2 > # TestFor->test_3() > ok 1 - Test 1 > 1..1 > ok 3 - test_3 > ok 1 – TestFor > > The elements in the exclude_tag array are not connected with an OR but > with an AND relation as you can see here > > Test::Class::Moose->new( include_tags => ['ALL'], > exclude_tags => ['001', 'ALL' ] )->runtests; > > C:\svn\Tools\Testbox>perl run.pl > 1..1 > # > # Running tests for TestFor > # > 1..2 > # TestFor->test_2() > ok 1 - Test 1 > 1..1 > ok 1 - test_2 > # TestFor->test_3() > ok 1 - Test 1 > 1..1 > ok 2 - test_3 > ok 1 - TestFor > > I guess this behavior is not correct. > > These tests where made with Test-Class-Moose-0.12 on Strawberry Perl > 5.16.3.1. > > I hope that you are ok with my description, it is my first bug report > I wrote for a CPAN module. > > Best regards > > Thomas > >
-- Your bugs , they are afraid of me.
Patch applied.Thanks! Cheers, Ovid On Mon Aug 12 17:35:07 2013, WSDOOKADR wrote: Show quoted text
> Hi Thomas, Ovid, > > I just made a fork and used Thomas's code to create a test and then > modified the code to pass the test. > Essentially in my view, exclude_tags should take priority over include_tags. > Please have a look. > > https://github.com/Ovid/test-class-moose/pull/15 > > Thanks, > Stefan > > On Mon Aug 12 15:09:40 2013, thomas.lokajczyk@gmx.de wrote:
> > Hi Ovid, > > > > I am very happy with your Test::Class::Moose module, especially the > > tag function is very helpful in my use case. But I found a little bug > > with the exclude_tags option. Here my test case: > > > > package TestFor; > > use Test::Class::Moose; > > > > sub test_1 : Tags( ALL 001 ){ > > ok(1, 'Test 1') > > }; > > > > sub test_2 : Tags( ALL 002 ){ > > ok(1, 'Test 1') > > }; > > > > sub test_3 : Tags( ALL 003 ){ > > ok(1, 'Test 1') > > }; > > > > 1; > > > > When I start this test with > > > > use FindBin; > > use lib "$FindBin::Bin/lib"; > > use Test::Class::Moose::Load ( 'lib/TestFor.pm', ); > > > > Test::Class::Moose->new( include_tags => ['ALL'] )->runtests; > > > > Every thing works fine: > > > > C:\svn\Tools\Testbox>perl run.pl > > 1..1 > > # > > # Running tests for TestFor > > # > > 1..3 > > # TestFor->test_1() > > ok 1 - Test 1 > > 1..1 > > ok 1 - test_1 > > # TestFor->test_2() > > ok 1 - Test 1 > > 1..1 > > ok 2 - test_2 > > # TestFor->test_3() > > ok 1 - Test 1 > > 1..1 > > ok 3 - test_3 > > ok 1 – TestFor > > > > Now I use the exclude_tags option: > > > > Test::Class::Moose->new( include_tags => ['ALL'], > > exclude_tags => ['001'] )->runtests; > > > > Here the result is still ok: > > > > C:\svn\Tools\Testbox>perl run.pl > > 1..1 > > # > > # Running tests for TestFor > > # > > 1..2 > > # TestFor->test_2() > > ok 1 - Test 1 > > 1..1 > > ok 1 - test_2 > > # TestFor->test_3() > > ok 1 - Test 1 > > 1..1 > > ok 2 - test_3 > > ok 1 – TestFor > > > > But when I use two tags to exclude it does not run as I would expect > > > > Test::Class::Moose->new( include_tags => ['ALL'], > > exclude_tags => ['001', '002' ] )->runtests; > > > > C:\svn\Tools\Testbox>perl run.pl > > 1..1 > > # > > # Running tests for TestFor > > # > > 1..3 > > # TestFor->test_1() > > ok 1 - Test 1 > > 1..1 > > ok 1 - test_1 > > # TestFor->test_2() > > ok 1 - Test 1 > > 1..1 > > ok 2 - test_2 > > # TestFor->test_3() > > ok 1 - Test 1 > > 1..1 > > ok 3 - test_3 > > ok 1 – TestFor > > > > The elements in the exclude_tag array are not connected with an OR but > > with an AND relation as you can see here > > > > Test::Class::Moose->new( include_tags => ['ALL'], > > exclude_tags => ['001', 'ALL' ] )->runtests; > > > > C:\svn\Tools\Testbox>perl run.pl > > 1..1 > > # > > # Running tests for TestFor > > # > > 1..2 > > # TestFor->test_2() > > ok 1 - Test 1 > > 1..1 > > ok 1 - test_2 > > # TestFor->test_3() > > ok 1 - Test 1 > > 1..1 > > ok 2 - test_3 > > ok 1 - TestFor > > > > I guess this behavior is not correct. > > > > These tests where made with Test-Class-Moose-0.12 on Strawberry Perl > > 5.16.3.1. > > > > I hope that you are ok with my description, it is my first bug report > > I wrote for a CPAN module. > > > > Best regards > > > > Thomas > > > >
>