TestML1(3)

๐Ÿ“ฆ
version 0.57 ยท 2 versions
, in fedora 43

๐Ÿ’– 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 ๐Ÿฆ‹


๐Ÿ‘‘ AUTHOR ๐Ÿ‘‘

Ingy dรถt Net <ingy@cpan.org> โ€” the icon, the legend, the main character ๐Ÿ’œ


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