]> git.vpit.fr Git - perl/modules/VPIT-TestHelpers.git/commitdiff
Add some tests
authorVincent Pit <vince@profvince.com>
Wed, 30 Jan 2013 15:59:33 +0000 (13:59 -0200)
committerVincent Pit <vince@profvince.com>
Wed, 30 Jan 2013 16:20:44 +0000 (14:20 -0200)
t/10-more-skip.t [new file with mode: 0644]
t/11-more-skip_all-load.t [new file with mode: 0644]
t/12-more-skip_all-import.t [new file with mode: 0644]
t/13-more-import.t [new file with mode: 0644]
t/20-leaner-skip.t [new file with mode: 0644]
t/21-leaner-skip_all-load.t [new file with mode: 0644]
t/22-leaner-skip_all-import.t [new file with mode: 0644]
t/23-leaner-import.t [new file with mode: 0644]

diff --git a/t/10-more-skip.t b/t/10-more-skip.t
new file mode 100644 (file)
index 0000000..65013fc
--- /dev/null
@@ -0,0 +1,24 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More tests => 5;
+
+use VPIT::TestHelpers;
+
+pass 'first test';
+
+SKIP: {
+ load_or_skip 'VPIT::NonExistent', '1.23', [ ], 1;
+ fail 'second test';
+}
+
+pass 'third test';
+
+SKIP: {
+ load_or_skip 'Cwd', undef, [ 'not_in_cwd_pm' ], 1;
+ fail 'fourth test';
+}
+
+pass 'fifth test';
diff --git a/t/11-more-skip_all-load.t b/t/11-more-skip_all-load.t
new file mode 100644 (file)
index 0000000..1de6125
--- /dev/null
@@ -0,0 +1,14 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use VPIT::TestHelpers;
+
+load_or_skip_all 'VPIT::NonExistent', '1.23';
+
+plan tests => 1;
+
+fail 'not reached';
diff --git a/t/12-more-skip_all-import.t b/t/12-more-skip_all-import.t
new file mode 100644 (file)
index 0000000..dc7b3c4
--- /dev/null
@@ -0,0 +1,14 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use VPIT::TestHelpers;
+
+load_or_skip_all 'Cwd', undef, [ 'not_in_cwd_pm' ];
+
+plan tests => 1;
+
+fail 'not reached';
diff --git a/t/13-more-import.t b/t/13-more-import.t
new file mode 100644 (file)
index 0000000..2dedf59
--- /dev/null
@@ -0,0 +1,24 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More;
+
+use VPIT::TestHelpers;
+
+load_or_skip_all 'Cwd', undef, [ 'abs_path' ];
+
+plan tests => 1;
+
+my $result = do {
+ local $@;
+ eval 'abs_path $^X';
+};
+
+my $expected = do {
+ require Cwd;
+ Cwd::abs_path($^X);
+};
+
+is $result, $expected, 'Cwd::abs_path() was imported into main';
diff --git a/t/20-leaner-skip.t b/t/20-leaner-skip.t
new file mode 100644 (file)
index 0000000..2a98279
--- /dev/null
@@ -0,0 +1,24 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::Leaner tests => 5;
+
+use VPIT::TestHelpers;
+
+pass 'first test';
+
+SKIP: {
+ load_or_skip 'VPIT::NonExistent', '1.23', [ ], 1;
+ fail 'second test';
+}
+
+pass 'third test';
+
+SKIP: {
+ load_or_skip 'Cwd', undef, [ 'not_in_cwd_pm' ], 1;
+ fail 'fourth test';
+}
+
+pass 'fifth test';
diff --git a/t/21-leaner-skip_all-load.t b/t/21-leaner-skip_all-load.t
new file mode 100644 (file)
index 0000000..352e867
--- /dev/null
@@ -0,0 +1,14 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::Leaner;
+
+use VPIT::TestHelpers;
+
+load_or_skip_all 'VPIT::NonExistent', '1.23';
+
+plan tests => 1;
+
+fail 'not reached';
diff --git a/t/22-leaner-skip_all-import.t b/t/22-leaner-skip_all-import.t
new file mode 100644 (file)
index 0000000..df2b186
--- /dev/null
@@ -0,0 +1,14 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::Leaner;
+
+use VPIT::TestHelpers;
+
+load_or_skip_all 'Cwd', undef, [ 'not_in_cwd_pm' ];
+
+plan tests => 1;
+
+fail 'not reached';
diff --git a/t/23-leaner-import.t b/t/23-leaner-import.t
new file mode 100644 (file)
index 0000000..8179206
--- /dev/null
@@ -0,0 +1,24 @@
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::Leaner;
+
+use VPIT::TestHelpers;
+
+load_or_skip_all 'Cwd', undef, [ 'abs_path' ];
+
+plan tests => 1;
+
+my $result = do {
+ local $@;
+ eval 'abs_path $^X';
+};
+
+my $expected = do {
+ require Cwd;
+ Cwd::abs_path($^X);
+};
+
+is $result, $expected, 'Cwd::abs_path() was imported into main';