Perl Cd Bookshelf [Electronic resources] نسخه متنی

اینجــــا یک کتابخانه دیجیتالی است

با بیش از 100000 منبع الکترونیکی رایگان به زبان فارسی ، عربی و انگلیسی

Perl Cd Bookshelf [Electronic resources] - نسخه متنی

| نمايش فراداده ، افزودن یک نقد و بررسی
افزودن به کتابخانه شخصی
ارسال به دوستان
جستجو در متن کتاب
بیشتر
تنظیمات قلم

فونت

اندازه قلم

+ - پیش فرض

حالت نمایش

روز نیمروز شب
جستجو در لغت نامه
بیشتر
لیست موضوعات
توضیحات
افزودن یادداشت جدید



8.203. Test::Simple


Provides basic utilities for writing
tests. It is shipped with the Perl source kit as of 5.8. For example:

my $name = 'Inigo Montoya';
my $quote = 'Prepare to die';
ok($name eq $quote, 'name is quote');

The ok function is given an expression to
evaluate. ok() prints out 'ok'
or 'not ok' along with the number of the test.

Here's another example that tests if you can use
CGI.pm:

#!/usr/local/bin/perl -w
use Test::Simple tests => 2;
use CGI; # Test this
my $cgi = CGI->new();
# Test #1—this will be ok
ok(defined($cgi) and ref $cgi eq 'CGI', 'I have your CGI right here!');
my $header = $cgi->header(-type => `text/plain');
# Test #2—this will not be ok
ok($header eq "Content-Type: text/mex");



8.202. Test::More8.204. Text::Abbrev




Copyright © 2002 O'Reilly & Associates. All rights reserved.

/ 875