This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate with Sarathy.
[perl5.git] / t / op / oct.t
CommitLineData
8d063cd8
LW
1#!./perl
2
4f19785b 3print "1..11\n";
8d063cd8 4
8ba208ab
CS
5print +(oct('01234') == 01234) ? "ok" : "not ok", " 1\n";
6print +(oct('0x1234') == 0x1234) ? "ok" : "not ok", " 2\n";
7print +(hex('01234') == 0x1234) ? "ok" : "not ok", " 3\n";
8print +(oct('20000000000') == 020000000000) ? "ok" : "not ok", " 4\n";
9print +(oct('x80000000') == 0x80000000) ? "ok" : "not ok", " 5\n";
10print +(hex('80000000') == 0x80000000) ? "ok" : "not ok", " 6\n";
3524d3b9
TP
11print +(oct('1234') == 668) ? "ok" : "not ok", " 7\n";
12print +(hex('1234') == 4660) ? "ok" : "not ok", " 8\n";
e3fdf988 13print +(hex('0x1234') == 0x1234) ? "ok" : "not ok", " 9\n";
4f19785b
WSI
14print +(oct('b11100') == 28) ? "ok" : "not ok", " 10\n";
15print +(oct('b101010') == 0b101010) ? "ok" : "not ok", " 11\n";