Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1295364

Browse files
committed
Add basic perl repo test
1 parent aee7843 commit 1295364

7 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/MYMETA.json
2+
/MYMETA.yml
3+
/Makefile
4+
/PreCommitHello-*.tar.*
5+
/PreCommitHello-*/
6+
/blib/
7+
/pm_to_blib
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
- id: perl-hook
2+
name: perl example hook
3+
entry: pre-commit-perl-hello
4+
language: perl
5+
files: ''
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MANIFEST
2+
Makefile.PL
3+
bin/pre-commit-perl-hello
4+
lib/PreCommitHello.pm
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use strict;
2+
use warnings;
3+
4+
use ExtUtils::MakeMaker;
5+
6+
WriteMakefile(
7+
NAME => "PreCommitHello",
8+
VERSION_FROM => "lib/PreCommitHello.pm",
9+
EXE_FILES => [qw(bin/pre-commit-perl-hello)],
10+
);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env perl
2+
3+
use strict;
4+
use warnings;
5+
use PreCommitHello;
6+
7+
PreCommitHello::hello();
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package PreCommitHello;
2+
3+
use strict;
4+
use warnings;
5+
6+
our $VERSION = "0.1.0";
7+
8+
sub hello {
9+
print "Hello from perl-commit Perl!\n";
10+
}
11+
12+
1;

tests/repository_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,3 +876,10 @@ def test_manifest_hooks(tempdir_factory, store):
876876
types=['file'],
877877
verbose=False,
878878
)
879+
880+
881+
def test_perl_hook(tempdir_factory, store):
882+
_test_hook_repo(
883+
tempdir_factory, store, 'perl_hooks_repo',
884+
'perl-hook', [], b'Hello from perl-commit Perl!\n',
885+
)

0 commit comments

Comments
 (0)