Chapter 5. Basic Testing Framework in Perl

5.1. Testing a simple command line tool

First we'll talk about a simple application with simple tests and from there you'll be able to move on to test more complex applications. I have a new calculator program called "mycalc". It expects a mathematical expression on the command line and prints the result on the screen. e.g.:

Example 5-1. mycalc on the command line

> mycalc 3 + 4  
7
Let's look at it first an then write a couple of tests for it.