Mac::Carbon and Testing

| | Comments (0)
I am normally loathe to write tests, but for Mac::Carbon, I am making an exception. So the other night, I started working on a test suite. It is far from exhaustive, but it is a nice beginning. It does things like get a list of your volumes, convert them from FSSpec to paths, make sure the paths exist with -d, runs an AppleScript to get the version of the Finder, gets/sets creator/type of files, displays the amount of RAM in and the clock speed of the machine, displays a notification dialog to tell you to switch various applications to the front/back, plays a sound from a resource file, talks using the speech manager, and more.

I am even using Test::More, which makes life easier. I may need to include it in MacPerl. It's all working really well thus far.

    ok(my $h = Handle->new('xyzzy'),    'new handle');
    is($h->get, 'xyzzy',            'get handle');
    is($h->size, 5,                'handle size');
    is($h->get(2, 2), 'zz',            'get handle portion');

I just need to add some more tests for Mac::Files and Mac::MoreFiles, then clean it up (which includes making it build on machines other than this one and integrating the changes with MacPerl). Then: profit! I mean: release!

Now Playing: Fired - Ben Folds (Rockin' the Suburbs)

use.perl.org

Leave a comment

<pudge/*> (pronounced "PudgeGlob") is thousands of posts over many years by Pudge.

"It is the common fate of the indolent to see their rights become a prey to the active. The condition upon which God hath given liberty to man is eternal vigilance; which condition if he break, servitude is at once the consequence of his crime and the punishment of his guilt."

About this Entry

This page contains a single entry by pudge published on November 7, 2002 5:42 AM.

About Time was the previous entry in this site.

Googlism is the next entry in this site.

Find recent content on the main index or look in the archives to find all content.