Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Done and thank you!

Here is my test file. I hope I wrote it correctly, and it is well formed. All the tests passed.

#!perl use strict; use warnings; use v5.10.0; use Test::More tests => "5"; use FindBin qw($Bin); BEGIN { use_ok( 'Fancy::Open', qw(fancy_open) ) or die "Fancy::Open is not available\n"; } diag( "Testing Fancy::Open $Fancy::Open::VERSION, Perl $], $^X" ); my $file = "$Bin/test-open.txt"; my @plain_array_wanted = qw(red orange yellow spring green teal cyan a +zure blue violet magenta pink white black gray); my @plain_array_run = Fancy::Open::fancy_open($file); is_deeply( \@plain_array_run, \@plain_array_wanted, "testing a plain array" ); my @before_array_wanted = ( "solid red", "solid orange", "solid yellow", "solid spring", "solid green", "solid teal", "solid cyan", "solid azure", "solid blue", "solid violet", "solid magenta", "solid pink", "solid white", "solid black", "solid gray" ); my @before_array_run = Fancy::Open::fancy_open($file, { 'before' => 's +olid ' }); is_deeply( \@before_array_wanted, \@before_array_run, "testing an array with before option" ); my @after_array_wanted = ( "red bead", "orange bead", "yellow bead", "spring bead", "green bead", "teal bead", "cyan bead", "azure bead", "blue bead", "violet bead", "magenta bead", "pink bead", "white bead", "black bead", "gray bead" ); my @after_array_run = Fancy::Open::fancy_open($file, { 'after' => ' be +ad' }); is_deeply( \@after_array_wanted, \@after_array_run, "testing an array with after option" ); my @both_array_wanted = ( "solid red bead", "solid orange bead", "solid yellow bead", "solid spring bead", "solid green bead", "solid teal bead", "solid cyan bead", "solid azure bead", "solid blue bead", "solid violet bead", "solid magenta bead", "solid pink bead", "solid white bead", "solid black bead", "solid gray bead" ); my @both_array_run = Fancy::Open::fancy_open($file, { 'before' => 'sol +id ', 'after' => ' bead' }); is_deeply( \@both_array_wanted, \@both_array_run, "testing an array with before and after options" ); done_testing();

My OS is Debian 10 (Buster); my perl versions are 5.28.1 local and 5.16.3 or 5.30.0 on web host depending on the shebang.

No matter how hysterical I get, my problems are not time sensitive. So, relax, have a cookie, and a very nice day!
Lady Aleena

In reply to Re^4: Can Test::MockObject mock a file? by Lady_Aleena
in thread Can Test::MockObject mock a file? by Lady_Aleena

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (None)
    As of 2024-04-25 04:02 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found