File: 02config.t

package info (click to toggle)
libinline-perl 0.44-3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 440 kB
  • ctags: 121
  • sloc: perl: 3,768; makefile: 38
file content (44 lines) | stat: -rw-r--r-- 901 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
use File::Spec;
use lib (File::Spec->catdir(File::Spec->updir(),'blib','lib'), File::Spec->catdir(File::Spec->curdir(),'blib','lib'));
use strict;
use Test;
use diagnostics;
use Inline Config => DIRECTORY => '_Inline_test';

BEGIN {
    plan(tests => 3,
	 todo => [],
	 onfail => sub {},
	);
}

# test 1 - Make sure config options are type checked
BEGIN {
    eval <<'END';
    use Inline(C => "void foo(){}",
	       LIBS => {X => 'Y'},
	      );
END
    ok(1);
#    ok($@ =~ /must be a string or an array ref/);
}

# test 2 - Make sure bogus config options croak
BEGIN {
    eval <<'END';
    use Inline(C => "void foo(){}",
	       FOO => 'Bar',
	      );
END
    ok($@ =~ /not a valid config option/);
}

# test 3 - Test the PREFIX config option
BEGIN {
    use Inline(C => 'char* XYZ_Howdy(){return "Hello There";}',
	       PREFIX => 'XYZ_',
	      );
    ok(Howdy eq "Hello There");
}

__END__