1TestML1(3) User Contributed Perl Documentation TestML1(3)
2
3
4
6 TestML1 - DEPRECATED Generic Software Testing Meta Language
7
9 This document describes TestML1 version 0.57.
10
12 TestML1 is DEPRECATED.
13
14 Actually TestML1 is the old 2009-2018 version of TestML, in case you
15 still need it. Check out the new TestML.
16
18 # file t/testml/encode.tml
19 %TestML 0.1.0
20
21 Title = 'Tests for AcmeEncode'
22 Plan = 3
23
24 *text.apply_rot13 == *rot13
25 *text.apply_md5 == *md5
26
27 === Encode some poetry
28 --- text
29 There once was a fellow named Ingy,
30 Combining languages twas his Thingy.
31 --- rot13
32 Gurer bapr jnf n sryybj anzrq Vatl,
33 Pbzovavat ynathntrf gjnf uvf Guvatl.
34 --- md5: 7a1538ff9fc8edf8ea55d02d0b0658be
35
36 === Encode a password
37 --- text: soopersekrit
38 --- md5: 64002c26dcc62c1d6d0f1cb908de1435
39
40 This TestML document defines 2 assertions, and defines 2 data blocks.
41 The first block has 3 data points, but the second one has only 2.
42 Therefore the rot13 assertion applies only to the first block, while
43 the the md5 assertion applies to both. This results in a total of 3
44 tests, which is specified in the meta Plan statement in the document.
45
46 To run this test you would have a normal test file that looks like
47 this:
48
49 use TestML1;
50 use t::Bridge;
51
52 TestML1->new(
53 testml => 'testml/encode.tml',
54 bridge => 't::Bridge',
55 )->run;
56
57 The apply_* functions are defined in the bridge class that is specified
58 outside this test ("t/Bridge.pm").
59
61 TestML is a generic, programming language agnostic, meta language for
62 writing unit tests. The idea is that you can use the same test files in
63 multiple implementations of a given programming idea. Then you can be
64 more certain that your application written in, say, Python matches your
65 Perl implementation.
66
67 In a nutshell you write a bunch of data tests that have inputs and
68 expected results. Using a simple syntax, you specify what functions the
69 data must pass through to produce the expected results. You use a
70 bridge class to write the data functions that pass the data through
71 your application.
72
73 In Perl 5, TestML is the evolution of the Test::Base module. It has a
74 superset of Test:Base's goals. The data markup syntax is currently
75 exactly the same as Test::Base.
76
78 • <http://www.testml.org/>
79
80 • <irc://irc.freenode.net#testml>
81
83 Ingy döt Net <ingy@cpan.org>
84
86 Copyright 2009-2018. Ingy döt Net.
87
88 This program is free software; you can redistribute it and/or modify it
89 under the same terms as Perl itself.
90
91 See <http://www.perl.com/perl/misc/Artistic.html>
92
93
94
95perl v5.32.1 2021-01-27 TestML1(3)