Skip to content

Commit

Permalink
Fake Win32API::Registry to test under linux
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bougard committed Jul 31, 2017
1 parent d014be8 commit 5717c72
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions t/lib/fake/windows/Win32API/Registry.pm
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package Win32API::Registry;

use strict;
use warnings;

my @Types = qw(
REG_NONE REG_SZ REG_EXPAND_SZ REG_BINARY REG_DWORD REG_DWORD_BIG_ENDIAN
REG_LINK REG_MULTI_SZ REG_RESOURCE_LIST REG_FULL_RESOURCE_DESCRIPTOR
REG_RESOURCE_REQUIREMENTS_LIST REG_QWORD
);

my $constant_index = 0 ;
my %constants = map { $_ => $constant_index++ } @Types;

sub constant {
my ($constant) = @_ ;

return $constants{$constant} if exists($constants{$constant});
}

1;

0 comments on commit 5717c72

Please sign in to comment.