File: encode-node-names.t

package info (click to toggle)
libwiki-toolkit-formatter-usemod-perl 0.25-1.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 176 kB
  • sloc: perl: 258; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 892 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use Wiki::Toolkit::Formatter::UseMod;
use Test::More tests => 4;

my $formatter = Wiki::Toolkit::Formatter::UseMod->new( munge_urls => 1 );
is( $formatter->node_name_to_node_param( "test page" ),
    "Test_Page", "->node_name_to_node_param forces ucfirst by default" );

$formatter = Wiki::Toolkit::Formatter::UseMod->new( force_ucfirst_nodes => 0,
                                                munge_urls          => 1 );
is( $formatter->node_name_to_node_param( "test page" ),
    "test_page", "...but not if force_ucfirst_nodes set to 0" );

$formatter = Wiki::Toolkit::Formatter::UseMod->new;
is( $formatter->node_name_to_node_param( "Home Page" ), "Home Page",
    "->node_name_to_node_param does nothing if munge_urls not true" );
is( $formatter->node_param_to_node_name( "Home_Page" ), "Home_Page",
    "->node_param_to_node_name does nothing if munge_urls not true" );