xref: /openbsd-src/gnu/usr.bin/perl/cpan/version/t/06noop.t (revision 3d61058aa5c692477b6d18acfbbdb653a9930ff9)
16fb12b70Safresh1#! /usr/local/perl -w
26fb12b70Safresh1# Before `make install' is performed this script should be runnable with
36fb12b70Safresh1# `make test'. After `make install' it should work as `perl test.pl'
46fb12b70Safresh1
56fb12b70Safresh1#########################
66fb12b70Safresh1
76fb12b70Safresh1use Test::More qw/no_plan/;
86fb12b70Safresh1
96fb12b70Safresh1BEGIN {
10*3d61058aSafresh1    use_ok('version', 0.9930);
116fb12b70Safresh1}
126fb12b70Safresh1
13eac174f2Safresh1my $v1 = 'version'->new('1.2');
146fb12b70Safresh1eval {$v1 = $v1 + 1};
156fb12b70Safresh1like $@, qr/operation not supported with version object/, 'No math ops with version objects';
166fb12b70Safresh1eval {$v1 = $v1 - 1};
176fb12b70Safresh1like $@, qr/operation not supported with version object/, 'No math ops with version objects';
186fb12b70Safresh1eval {$v1 = $v1 / 1};
196fb12b70Safresh1like $@, qr/operation not supported with version object/, 'No math ops with version objects';
206fb12b70Safresh1eval {$v1 = $v1 * 1};
216fb12b70Safresh1like $@, qr/operation not supported with version object/, 'No math ops with version objects';
226fb12b70Safresh1eval {$v1 = abs($v1)};
236fb12b70Safresh1like $@, qr/operation not supported with version object/, 'No math ops with version objects';
246fb12b70Safresh1
256fb12b70Safresh1eval {$v1 += 1};
266fb12b70Safresh1like $@, qr/operation not supported with version object/, 'No math ops with version objects';
276fb12b70Safresh1eval {$v1 -= 1};
286fb12b70Safresh1like $@, qr/operation not supported with version object/, 'No math ops with version objects';
296fb12b70Safresh1eval {$v1 /= 1};
306fb12b70Safresh1like $@, qr/operation not supported with version object/, 'No math ops with version objects';
316fb12b70Safresh1eval {$v1 *= 1};
326fb12b70Safresh1like $@, qr/operation not supported with version object/, 'No math ops with version objects';
33