File: basic.t

package info (click to toggle)
libsyntax-perl 0.004-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 132 kB
  • sloc: perl: 162; makefile: 2
file content (31 lines) | stat: -rw-r--r-- 723 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/env perl
use strict;
use warnings;

use FindBin;
use lib "$FindBin::Bin/lib";

use Test::More 0.94;

my $imported_options = do {
    package TestSyntaxImporter;
    use syntax test_foo => { bar => 23 };
    foo;
    no syntax 'test_foo';
};

my $deep_imported_options = do {
    package TestSubSyntaxImporter;
    use syntax 'test_foo/bar' => { baz => 17 };
    bar;
};

is_deeply $imported_options, { bar => 23 },
    'imported options were received';
is_deeply $deep_imported_options, { baz => 17 },
    'imported subsyntax options were received';

is $Syntax::Feature::TestFoo::CALL{install}, 1, 'install called once';
is $Syntax::Feature::TestFoo::CALL{uninstall}, 1, 'uninstall called once';

done_testing;