Test::More

Last updated
Test::More
Original author(s) Michael G Schwern
Developer(s) Chad 'Exodist' Granum
Initial releaseApril, 2001
Written inPerl
Operating system Cross-platform
Available in English
Type Unit testing module
License Dual-licensed - Artistic License and GPL
Website https://metacpan.org/pod/Test::More

Test::More is a unit testing module for Perl. Created and maintained by Michael G Schwern with help from Barrie Slaymaker, Tony Bowden, chromatic, Fergal Daly and perl-qa.

Contents

Test::More is the most popular Perl testing module, as of this 2010 about 80% of all CPAN distributions made use of it. [1]

History

Introduced in 2001 to replace Test.pm, Test::More simplified the culture of testing in Perl leading to a proliferation of new testing modules and a strongly test driven community.

In January–March 2014 Michael Schwern transferred ownership of Test::More and related modules to Chad 'Exodist' Granum. [2] On May 10, 2016 Exodist released version 1.302015 [3] [4] which included a complete refactor and partial rewrite of the internals. The new version includes major API updates and introduced several enhanced features. Extreme care was taken to preserve backwards compatibility for third party tools.[ tone ]

Functionality

Test::More is not a framework but can be used in conjunction with other testing libraries via a shared Test::Builder object. As a result, Test::More provides the baseline testing functions leaving other libraries to implement more specific and sophisticated functionality. This removes what would otherwise be a development bottleneck and allows a rich ecosystem of specialized niche testing functions.

Test::More is not a complete testing framework. Rather, test programs written with Test::More output their results as TAP which can then either be interpreted by a human, or more usually run through a TAP parser such as Test::Harness. [5] :424 It is this separation between test program and test result interpreter via a common protocol which allows Perl programmers to develop so many different testing modules and use them in combination. Additionally, the TAP output can be stored and reinterpreted later providing a historical record of test results.

Among its features are more comprehensive error messages, functions to test regular expressions, functions to test objects, and functions to test complex data structures. [6] :115 It can be used to compare values, such as a computed value to an expected value, or that a value is within an expected range. [7] :217 The number of tests to be executed is listed in the test script. [8] :202

Tests that are known to fail under specific conditions or environments can be skipped. [6] :115 This may occur if a system on which the test is executed lacks the capability to execute the tested function, or if the test is written in advance of the code. [7] :218

The module intercepts standard output from the Perl script to execute the tests. [9] :31

Related Research Articles

The Comprehensive Perl Archive Network (CPAN) is a repository of over 250,000 software modules and accompanying documentation for 39,000 distributions, written in the Perl programming language by over 12,000 contributors. CPAN can denote either the archive network or the Perl program that acts as an interface to the network and as an automated software installer. Most software on CPAN is free and open source software.

<span class="mw-page-title-main">Perl</span> Interpreted programming language first released in 1987

Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was officially changed to Raku in October 2019.

<span class="mw-page-title-main">Ruby (programming language)</span> General-purpose programming language

Ruby is an interpreted, high-level, general-purpose programming language which supports multiple programming paradigms. It was designed with an emphasis on programming productivity and simplicity. In Ruby, everything is an object, including primitive data types. It was developed in the mid-1990s by Yukihiro "Matz" Matsumoto in Japan.

In computing, serialization or serialisation is the process of translating a data structure or object state into a format that can be stored or transmitted and reconstructed later. When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of the original object. For many complex objects, such as those that make extensive use of references, this process is not straightforward. Serialization of object-oriented objects does not include any of their associated methods with which they were previously linked.

VBScript is an Active Scripting language developed by Microsoft that is modeled on Visual Basic. It allows Microsoft Windows system administrators to generate powerful tools for managing computers with error handling, subroutines, and other advanced programming constructs. It can give the user complete control over many aspects of their computing environment.

A Perl module is a discrete component of software for the Perl programming language. Technically, it is a particular set of conventions for using Perl's package mechanism that has become universally adopted.

In some programming languages, eval, short for the English evaluate, is a function which evaluates a string as though it were an expression in the language, and returns a result; in others, it executes multiple lines of code as though they had been included instead of the line including the eval. The input to eval is not necessarily a string; it may be structured representation of code, such as an abstract syntax tree, or of special type such as code. The analog for a statement is exec, which executes a string as if it were a statement; in some languages, such as Python, both are present, while in other languages only one of either eval or exec is.

<span class="mw-page-title-main">Raku (programming language)</span> Programming language derived from Perl

Raku is a member of the Perl family of programming languages. Formerly known as Perl 6, it was renamed in October 2019. Raku introduces elements of many modern and historical languages. Compatibility with Perl was not a goal, though a compatibility mode is part of the specification. The design process for Raku began in 2000.

CGI.pm is a large and once widely used Perl module for programming Common Gateway Interface (CGI) web applications, providing a consistent API for receiving and processing user input. There are also functions for producing HTML or XHTML output, but these are now unmaintained and are to be avoided. CGI.pm was a core Perl module but has been removed as of v5.22 of Perl. The module was written by Lincoln Stein and is now maintained by Lee Johnson.

Pugs is a compiler and interpreter for the Raku programming language, started on February 1, 2005, by Audrey Tang.

The Perl Object Environment or POE is a library of Perl modules written in the Perl programming language by Rocco Caputo et al.

Catalyst is an open source web application framework written in Perl, that closely follows the model–view–controller (MVC) architecture, and supports a number of experimental web patterns. It is written using Moose, a modern object system for Perl. Its design is heavily inspired by frameworks such as Ruby on Rails, Maypole, and Spring.

MooTools is a lightweight, object-oriented JavaScript framework. It is released under the free, open-source MIT License.

Sean Michael Burke is a Perl programmer, author, and linguist. He was a columnist for The Perl Journal from 1998 and has written several dozen Perl modules for CPAN, as well as books for O'Reilly Media.

Moose is an extension of the object system of the Perl programming language. Its stated purpose is to bring modern object-oriented language features to Perl 5, and to make object-oriented Perl programming more consistent and less tedious.

<span class="mw-page-title-main">Plack (software)</span>

Plack is a Perl web application programming framework inspired by Rack for Ruby and WSGI for Python, and it is the project behind the PSGI specification used by other frameworks such as Catalyst and Dancer. Plack allows for testing of Perl web applications without a live web server.

The structure of the Perl programming language encompasses both the syntactical rules of the language and the general ways in which programs are organized. Perl's design philosophy is expressed in the commonly cited motto "there's more than one way to do it". As a multi-paradigm, dynamically typed language, Perl allows a great degree of flexibility in program design. Perl also encourages modularization; this has been attributed to the component-based design structure of its Unix roots, and is responsible for the size of the CPAN archive, a community-maintained repository of more than 100,000 modules.

Mojolicious is a real-time web application framework, written by Sebastian Riedel, creator of the web application framework Catalyst. Licensed as free software under the Artistic License v 2.0, it is written in the Perl programming language, and is designed for use in both simple and complex web applications, based on Riedel's previous experience developing Catalyst. Documentation for the framework was partly funded by a grant from The Perl Foundation.

The following outline is provided as an overview of and topical guide to the Perl programming language:

An immediately invoked function expression is a programming language idiom which produces a lexical scope using function scoping. It was popular in JavaScript as a method to support modular programming before the introduction of more standardized solutions such as CommonJS and ES modules.

References

  1. Poe, Curtis. "Test::Most". CPAN.
  2. Granum, Chad (14 March 2014). "Test::More - New Maintainer, Also stop version checking!".
  3. "Test::More". CPAN.
  4. Granum, Chad (9 May 2016). "Test2+Test-Simple released!".
  5. Conway, Damian (2005). Perl Best Practices . O'Reilly Media. ISBN   9780596001735.
  6. 1 2 Tregar, Sam (2002). Writing Perl Modules for CPAN. Apress. ISBN   9781430211525.
  7. 1 2 Cozens, Simon (2005). Advanced Perl Programming . O'Reilly Media. ISBN   9781449378912.
  8. Galbraith, Patrick (2009). Developing Web Applications with Apache, MySQL, Memcached, and Perl. Wiley. ISBN   9780470538326.
  9. Diment, Kieren; Trout, Matt (2009). The Definitive Guide to Catalyst. Apress. ISBN   9781430223665.