Wiki::...estLib(3pm)
β¨ Wiki::Toolkit::TestLib β¨
Okay so this is the manual page for Wiki::Toolkit::TestLib, part of the User Contributed Perl Documentation. It's giving "test helper module realness" and honestly? We stan a utility queen. π
πΈ NAME πΈ
Wiki::Toolkit::TestLib β literally just utilities for writing Wiki::Toolkit tests. That's it. That's the vibe. π
π DESCRIPTION π
So here's the tea, bestie: when you run perl Makefile.PL on a Wiki::Toolkit distribution, it goes around gathering info about test databases and stuff that you can use for running tests. And Wiki::Toolkit::TestLib? It gives you convenient access to all that info. No cap. π«Ά
β¨ SYNOPSIS β¨
use strict;
use Wiki::Toolkit::TestLib;
use Test::More;
my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
plan tests => ( $iterator->number * 6 );
while ( my $wiki = $iterator->new_wiki ) {
# put some test data in
# run six tests
}
Every single time you call ->next on your iterator, you get a fresh blank wiki object. Iconic. The iterator will iterate over all configured search and storage backends.
Also important: the Lucy search backend is configured to index three metadata fields β address, category, and locale. Slay. π₯
π METHODS π
π¦ new_wiki_maker
my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
This is the main character constructor. Makes you your iterator. Periodt.
π§ number
use Test::More;
my $iterator = Wiki::Toolkit::TestLib->new_wiki_maker;
plan tests => ( $iterator->number * 6 );
Returns the number of new wikis that your iterator will be able to give you. Very "how many outfits do I have left" energy. π
π new_wiki
my $wiki = $iterator->new_wiki;
Returns a fresh blank wiki object β or false if you've used up all the configured search and storage backends. So like, when it's empty, it's empty. Sad but true. π
π configured_databases
my @configured_databases = $iterator->configured_databases;
Returns the @configured_databases array detailing configured test databases. Useful for very low-level testing only β like, do not come for this method unless you know what you're doing, iykyk. π
π SEE ALSO π
Wiki::Toolkit
π AUTHOR π
Kake Pugh (kake@earth.li). A legend. π«‘
π COPYRIGHT π
Copyright (C) 2003-2004 Kake Pugh. All Rights Reserved.
Copyright (C) 2008 the Wiki::Toolkit team. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. So like, go off. πΈ
β οΈ CAVEATS β οΈ
Okay so if you have the Search::InvertedIndex backend configured (see Wiki::Toolkit::Search::SII), your tests will raise warnings like these in unexpected places:
(in cleanup) Search::InvertedIndex::DB::Mysql::lock() -
testdb is not open. Can't lock.
at /usr/local/share/perl/5.6.1/Search/InvertedIndex.pm line 1348
or
(in cleanup) Can't call method "sync" on an undefined value
at /usr/local/share/perl/5.6.1/Tie/DB_File/SplitHash.pm line 331
during global destruction.
The author literally said: "I don't know whether this is a bug in me or in Search::InvertedIndex." And honestly? Same. π It's a whole mystery. Not me getting jump-scared by random warnings mid-test run. π«
β¨π And that's the whole page, bestie! This was Wiki::Toolkit::TestLib, from perl v5.32.0, dated 2021-01-04. Go write some iconic tests. Mwah! πβ¨
π¦ where this page comes from
- debian bookworm: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu jammy: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libwiki-toolkit-perl 0.86-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms