Liveman
view release on metacpan or search on metacpan
lib/Liveman.pm view on Meta::CPAN
=head3 C<like> inners with extrapolate-string
The scalar must contain the extrapolated term:
my $var = 'x';
'abxc' # *=> b$var
'abxs' # ⥴ b$var
=head3 C<like> begins with nonextrapolate-string
The scalar must begin with a non-extrapolated term:
'abbc' # ^-> ab
'abc' # ⣠ab
=head3 C<like> ends with nonextrapolate-string
The scalar must end with a non-extrapolated term:
'abbc' # $-> bc
'abc' # ⥠bc
=head3 C<like> inners with nonextrapolate-string
The scalar must contain a non-extrapolated term:
'abbc' # *-> bb
'abc' # ⥵ b
=head3 C<like> throw begins with nonextrapolate-string
The exception must start with the non-extrapolated term:
1/0 # @-> Illegal division by zero
1/0 # ⯠Illegal division by zero
=head3 C<like> throw begins with extrapolate-string
The exception must start with the extrapolated timing:
my $by = 'by';
1/0 # @=> Illegal division $by zero
1/0 # ⤯ Illegal division $by zero
=head3 C<like> throw
The exception must be matched to the regular expression:
1/0 # @~> division\s*by\s*zero
1/0 # â division\s*by\s*zero
=head3 C<unlike> throw
The exception doesn't have to be matched by the regular expression (but it should be):
1/0 # <~@ auto
1/0 # â auto
=head2 EMBEDDING FILES
Each test is performed in a temporary catalog, which is removed and created when starting the dough.
The format of this catalog: /tmp/.liveman/I<project>/I<path-to-test>/.
The code section in the line with the MD-file prefix B<< File C<path>: >> is written to the file when testing during execution.
The code section in the md file prefix line B<< File C<path> is: >> will be compared to the file using the C<Test::More::is> method.
experiment/test.txt file:
hi!
experiment/test.txt file is:
hi!
B<Attention!> An empty line between the prefix and the code is not allowed!
These prefixes can be both in English and in Russian (C<File [path] (https://metacpan.org/pod/path):> and C<File [path] (https://metacpan.org/pod/path) is:>).
=head1 METHODS
=head2 new (%param)
Constructor. Has arguments:
=over
=item 1. C<Files> (array_ref)-a list of MD files for theC<transforms> and C<tests>.
=item 2. C<open> (boolean) - open the coating in the browser. If the computer is installed on the computer B<Opera>, the C<Opera> command will be used to open. Otherwise-C<xdg-open>.
=item 3. C<force_compile> (boolean)-do not check the time of modification of MD files.
=item 4. C<options> - Add the parameters on the command line for verification or evidence.
=item 5. C<prove> - use the proof (team C<prove> to start tests), and not the C<yath> command.
=back
=head2 test_path ($md_path)
Get the way to C<t/**.t>-file from the way toC<lib/**.md>-file:
Liveman->new->test_path("lib/PathFix/RestFix.md") # => t/path-fix/rest-fix.t
=head2 transform ($md_path, [$test_path])
Compiles C<lib/**.md>-file inC<t/**.t>-file.
It also replaces the B<pod> documentation in the C<__END__> section in the C<lib/**.pm> file and creates a C<lib/**.pm> file if it exists, otherwise it creates a C<lib/**.pod> file.
When C<transform> was called in C<SYNOPSYS>, a file C<lib/Example.pod> was created.
The lib/Example.pod file is:
Twice two:
2*2 # -> 2+2
( run in 0.397 second using v1.01-cache-2.11-cpan-71847e10f99 )