TestML1(3)
๐ TestML1 โ the DEPRECATED Generic Software Testing Meta Language ๐
okay bestie, we're looking at the TestML1(3) page, which is a Perl user-contributed manual page, and it's literally a whole vibe. let's get into it ๐ซถ
โจ VERSION โจ
This doc is describing TestML1 version 0.57. that's the number, no cap.
๐ STATUS ๐
TestML1 is DEPRECATED.
okay so real talk: TestML1 is the old 2009โ2018 version of TestML. it's giving vintage. it's giving "still in the closet, but make it iconic." if you still need it, it's here for you, bestie. but check out the new TestML, fr fr. ๐
๐ SYNOPSIS ๐
picture this: you've got a test file at t/testml/encode.tml and it looks like this:
# file t/testml/encode.tml
%TestML 0.1.0
Title = 'Tests for AcmeEncode'
Plan = 3
*text.apply_rot13 == *rot13
*text.apply_md5 == *md5
=== Encode some poetry
--- text
There once was a fellow named Ingy,
Combining languages twas his Thingy.
--- rot13
Gurer bapr jnf n sryybj anzrq Vatl,
Pbzovavat ynathntrf gjnf uvf Guvatl.
--- md5: 7a1538ff9fc8edf8ea55d02d0b0658be
=== Encode a password
--- text: soopersekrit
--- md5: 64002c26dcc62c1d6d0f1cb908de1435
so let's do the math, girl math but make it real math ๐งฎ โ this TestML document defines 2 assertions, and it defines 2 data blocks. the first block has 3 data points, but the second one has only 2. so the rot13 assertion only applies to the first block, while the md5 assertion applies to both. that adds up to 3 tests total, which is exactly what the meta Plan statement in the document says. slay, consistent. โ
and to actually run this test, you'd have a normal test file that looks like this:
use TestML1;
use t::Bridge;
TestML1->new(
testml => 'testml/encode.tml',
bridge => 't::Bridge',
)->run;
the apply_* functions are defined in the bridge class, and that bridge class is specified outside this test โ it lives at t/Bridge.pm. iykyk ๐ง
๐ธ DESCRIPTION ๐ธ
TestML is a generic, programming-language-agnostic, meta language for writing unit tests. the whole idea? you can use the same test files across multiple implementations of a given programming idea. then you can be way more certain that your app written in, say, Python actually matches your Perl implementation. cross-language consistency? we love to see it ๐
in a nutshell (cute, cozy, nut-shaped ๐ฅ): you write a bunch of data tests that have inputs and expected results. using a simple syntax, you specify what functions the data must pass through to produce those expected results. and you use a bridge class to write the data functions that pass the data through your application.
in Perl 5, TestML is the evolution of the Test::Base module. it has a superset of Test:Base's goals. and the data markup syntax is currently exactly the same as Test::Base. same syntax, glow-up energy โจ
๐ฆ SEE ALSO ๐ฆ
- <http://www.testml.org/>
- <irc://irc.freenode.net#testml>
๐ AUTHOR ๐
Ingy dรถt Net <ingy@cpan.org> โ the icon, the legend, the main character ๐
๐ COPYRIGHT AND LICENSE ๐
Copyright 2009-2018. Ingy dรถt Net.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See <http://www.perl.com/perl/misc/Artistic.html>
and that's the whole page, bestie!! ๐ซถ this was perl v5.42.0, dated 2025-07-25, straight from the TestML1(3) manual. go forth and test your software, you absolute legend. periodt. ๐โจ๐ธ
๐ฆ where this page comes from
- fedora 43: perl-TestML1 0.57-22.fc43 ยท GPL-1.0-or-later OR Artistic-1.0-Perl
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms