Language Selection

English French German Italian Portuguese Spanish

Writing Perl test cases

Filed under
HowTos

If you've ever automated any operations with Perl you'll most likely have written a small script or two, and then left them to run. But how do you know that your code is correct? The answer is to write some test cases and verify they perform correctly. With Perls test facilities this is a simple thing to do.

Most large Perl projects have a test suite, and so do many of the common modules you'll have installed.

To get started we'll look at a simple example. Suppose your script uses some non-standard Perl modules that suggests the very first test you write should verify that those are available. That way if you attempt to run the program upon a new host you'll immediately know whether you need to install these non-standard modules.

Full Article.

More in Tux Machines

Leftovers: Software

  • GJS: What’s next?
    In my last post, I went into detail about all the new stuff that GJS brought to GNOME 3.24. Now, it’s time to talk about the near future: what GJS will bring to GNOME 3.26.
  • Sending SMS from Linux Just Got Easier with Latest Indicator KDE Connect Update
    Indicator KDE Connect now has Google Contacts integration, making it even easier to send text messages from the Linux desktop.
  • Cumulus Qt is a Lightweight Weather App for Linux
    Cumulus Qt is a Qt weather app for the Linux desktop. It's lightweight, has a bold, striking design inspired by Stormcloud, and is very customisable.
  • Vivaldi 1.10 Browser Now in Development, Will Introduce Docked Developer Tools
    Vivaldi's Ruarí Ødegaard just informed us a few moments ago that Vivaldi 1.10 will be the next major version of the free and cross-platform web browser based on the latest Chromium technologies, not Vivaldi 2.0 as many of you have hoped. Vivaldi 1.9 just hit the streets the other day as world's first web browser to ship with the Ecosia search engine enabled by default to help reforest the plane, and it now looks like Vivaldi's devs never sleep, and development of Vivaldi 1.10 starts today with the first snapshot, Vivaldi 1.10.829.3, which introduces a long-anticipated feature: Docked Developer Tools!

today's howtos

Fedora: The Latest (Flatpak, Wallpapers, and PHP)

  • Flatpak and Snaps aren't destined for graveyard of failed Linux tech yet
    The world of Linux has long been divided into tribes, or distros as we called them. But what actually makes a distro? The packages it uses? The people who put those packages together? The philosophy behind the choices the people who put the packages together make? The question of what makes a distro is actually very difficult on to answer and it's about to get even more difficult. There's a change coming to the world of Linux that's potentially big enough to make us rethink what a distro is and how it works. That change is Ubuntu's Snap packages and the parallel effort dubbed Flatpaks. While these two projects differ in the details, for the purposes of this article I'll consider them the same thing and use the terms interchangeably.
  • Need a New Wallpaper? Fedora 26 Has You Covered!
    Fedora 26 will ship with a stunning set of community-contributed wallpapers, and as ever, the standard of entries in the contest is incredibly high.
  • Fedora 26 will look awesome with supplemental wallpapers
  • PHP version 7.0.19RC1 and 7.1.5RC1

Tizen and Android