Devel-PerlySense
view release on metacpan or search on metacpan
t/PerlySense-Editor-Vim-output.t view on Meta::CPAN
#!/usr/bin/perl -w
use strict;
use Test::More tests => 12;
use Test::Exception;
use Test::Differences;
use Data::Dumper;
use lib "lib";
use_ok("Devel::PerlySense");
use_ok("Devel::PerlySense::Editor::Vim");
ok(my $oPerlySense = Devel::PerlySense->new(), "Created PerlySense object ok");
ok(
my $oEditor = Devel::PerlySense::Editor::Vim->new(
oPerlySense => $oPerlySense,
widthDisplay => 10,
),
"Created Editor ok",
);
my %identifier_input_output = (
"a" => "a",
"a_b" => "a_b",
"c-d" => "c-d",
"c*d" => "c*d",
"c d" => "c d",
);
for my $input (sort keys %identifier_input_output) {
my $output = $identifier_input_output{$input};
is($oEditor->renameIdentifier($input), $output, "Identifier ($input) -> ($output)");
}
note("Vim data structure");
is(
$oEditor->formatOutputDataStructure(
rhData => {
hej => "Baberiba",
2 => "two",
},
),
qq|{"2": "two", "hej": "Baberiba"}|,
"Simple structure ok",
);
is(
$oEditor->formatOutputDataStructure(
rhData => {
hej => [ "Ba", "beriba" ],
2 => "two",
},
),
( run in 1.015 second using v1.01-cache-2.11-cpan-5b529ec07f3 )