File: 08interpolate.t

package info (click to toggle)
libdata-phrasebook-perl 0.35-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 276 kB
  • sloc: perl: 1,242; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 626 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
#!/usr/bin/perl -w
use strict;
use vars qw( $class $subclass );

use Test::More tests => 4;

# ------------------------------------------------------------------------

BEGIN {
    $class = 'Data::Phrasebook';
    use_ok $class;
}

my $file = 't/08phrases.txt';

# ------------------------------------------------------------------------

{
    my $obj = $class->new;
    isa_ok( $obj => "${class}::Plain", 'Class new' );
    $obj->file( $file );
    is( $obj->file() => $file , 'Set/get file works');

    my $str = $obj->fetch( 'baz', {foo => '${bar}', bar => '${foo}'} );
    is($str, 'foo is ${bar} and bar is ${foo}');
}