aboutsummaryrefslogtreecommitdiffstats
path: root/t/100-increment-decrement.t
blob: 5d7287ac71ef1bbeeba710685d59499ad1ef4a12 (plain)
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
34
35
36
37
38
39
40
#!/usr/bin/env perl -w

use strict;

use Test::More;

use lib './';
use incdec;

is(
	incdec::incdec('test 12'),
	'test 13',
	'increments an integer'
);

is(
	incdec::incdec('test 12 0'),
	'test 13 0',
	'increments the first integer'
);

is(
	incdec::incdec('test 12 0', 6),
	'test 13 0',
	'increments the first integer with point at position 6'
);

is(
	incdec::incdec('test 19 0', 6),
	'test 20 0',
	'increments the first integer with point at position 6'
);

is(
	incdec::incdec('test 12 0', 7),
	'test 12 1',
	'increments the second integer with point at position 7'
);

done_testing;