-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy path06noop.t
33 lines (28 loc) · 1.3 KB
/
06noop.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#! /usr/local/perl -w
# Before `make install' is performed this script should be runnable with
# `make test'. After `make install' it should work as `perl test.pl'
#########################
use strict;
use Test::More qw/no_plan/;
BEGIN {
use_ok('version', 0.9928);
}
my $v1 = 'version'->new('1.2');
eval {$v1 = $v1 + 1};
like $@, qr/operation not supported with version object/, 'No math ops with version objects';
eval {$v1 = $v1 - 1};
like $@, qr/operation not supported with version object/, 'No math ops with version objects';
eval {$v1 = $v1 / 1};
like $@, qr/operation not supported with version object/, 'No math ops with version objects';
eval {$v1 = $v1 * 1};
like $@, qr/operation not supported with version object/, 'No math ops with version objects';
eval {$v1 = abs($v1)};
like $@, qr/operation not supported with version object/, 'No math ops with version objects';
eval {$v1 += 1};
like $@, qr/operation not supported with version object/, 'No math ops with version objects';
eval {$v1 -= 1};
like $@, qr/operation not supported with version object/, 'No math ops with version objects';
eval {$v1 /= 1};
like $@, qr/operation not supported with version object/, 'No math ops with version objects';
eval {$v1 *= 1};
like $@, qr/operation not supported with version object/, 'No math ops with version objects';