.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.48) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "Test2::Handle 3perl" .TH Test2::Handle 3perl 2026-10-17 "perl v5.44.0" "Perl Programmers Reference Guide" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Test2::Handle \- Base class for Test2 handles used in V# bundles. .SH DESCRIPTION .IX Header "DESCRIPTION" This is what you interact with when you use the \f(CWT2()\fR function in a test that uses Test2::V1. .SH SYNOPSIS .IX Header "SYNOPSIS" .SS RECOMMENDED .IX Subsection "RECOMMENDED" .Vb 1 \& use Test2::V1; \& \& my $handle = T2(); \& \& $handle\->ok(1, "Passing Test"); .Ve .SS "WITHOUT SUGAR" .IX Subsection "WITHOUT SUGAR" .Vb 1 \& use Test2::Handle(); \& \& my $handle = Test2::Handle\->new(base => \*(AqTest2::V1::Base\*(Aq); \& \& $handle\->ok(1, "Passing test"); .Ve .SH METHODS .IX Header "METHODS" Most methods are delegated to the base class provided at construction. There are however a few methods that are defined by this package itself. .ie n .IP "$base = $class_or_inst\->DEFAULT_HANDLE_BASE" 4 .el .IP "\f(CW$base\fR = \f(CW$class_or_inst\fR\->DEFAULT_HANDLE_BASE" 4 .IX Item "$base = $class_or_inst->DEFAULT_HANDLE_BASE" Get the default handle base. This throws an exception on the base handle class, you should override it in a subclass. .ie n .IP "$base = $inst\->HANDLE_BASE" 4 .el .IP "\f(CW$base\fR = \f(CW$inst\fR\->HANDLE_BASE" 4 .IX Item "$base = $inst->HANDLE_BASE" In this base class this method always throws an exception. In a subclass it should return the default base class to use for that subclass. .ie n .IP "$namespace = $inst\->HANDLE_NAMESPACE" 4 .el .IP "\f(CW$namespace\fR = \f(CW$inst\fR\->HANDLE_NAMESPACE" 4 .IX Item "$namespace = $inst->HANDLE_NAMESPACE" Get the namespace used to store function we wrap as methods. .ie n .IP "@sub_names = $inst\->HANDLE_SUBS" 4 .el .IP "\f(CW@sub_names\fR = \f(CW$inst\fR\->HANDLE_SUBS" 4 .IX Item "@sub_names = $inst->HANDLE_SUBS" Get a list of all subs available in the handle namespace. .ie n .IP "$inst\->HANDLE_INCLUDE($package, @subs)" 4 .el .IP "\f(CW$inst\fR\->HANDLE_INCLUDE($package, \f(CW@subs\fR)" 4 .IX Item "$inst->HANDLE_INCLUDE($package, @subs)" Import the specified subs from the specified package into our internal namespace. .ie n .IP "$inst = $class\->\fBimport()\fR" 4 .el .IP "\f(CW$inst\fR = \f(CW$class\fR\->\fBimport()\fR" 4 .IX Item "$inst = $class->import()" Used to create a \f(CWT2()\fR sub in your namsepace at import. .ie n .IP $inst\->\fBinit()\fR 4 .el .IP \f(CW$inst\fR\->\fBinit()\fR 4 .IX Item "$inst->init()" Internally used to intialize and validate the handle object. .IP AUTOLOAD 4 .IX Item "AUTOLOAD" Internally used to wrap functions as methods. .SH SOURCE .IX Header "SOURCE" The source code repository for Test2\-Suite can be found at \&\fIhttps://github.com/Test\-More/test\-more/\fR. .SH MAINTAINERS .IX Header "MAINTAINERS" .IP "Chad Granum " 4 .IX Item "Chad Granum " .SH AUTHORS .IX Header "AUTHORS" .IP "Chad Granum " 4 .IX Item "Chad Granum " .SH COPYRIGHT .IX Header "COPYRIGHT" Copyright Chad Granum . .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .PP See \fIhttp://dev.perl.org/licenses/\fR