Newer
Older
NetAddr-IP / t / over-qq.t
@Luis Muñoz Luis Muñoz on 21 Oct 2014 800 bytes Import of LUISMUNOZ/NetAddr-IP-4.003 from CPAN.
  1. use NetAddr::IP;
  2.  
  3. # $Id: over-qq.t,v 1.1.1.1 2006/08/14 15:36:06 lem Exp $
  4.  
  5. my @addr = ('10.0.0.0/8', '192.168.0.0/16', '127.0.0.1/32');
  6.  
  7. $| = 1;
  8.  
  9. print "1..", 5 * scalar @addr, "\n";
  10.  
  11. my $count = 1;
  12.  
  13. for my $a (@addr) {
  14. my $ip = new NetAddr::IP $a;
  15. if ($a eq "$ip") {
  16. print "ok $count\n";
  17. }
  18. else {
  19. print "not ok $count\n";
  20. }
  21. ++ $count;
  22.  
  23. if ($a eq $ip) {
  24. print "ok $count\n";
  25. }
  26. else {
  27. print "not ok $count\n";
  28. }
  29. ++ $count;
  30.  
  31. if ($ip eq $a) {
  32. print "ok $count\n";
  33. }
  34. else {
  35. print "not ok $count\n";
  36. }
  37. ++ $count;
  38.  
  39. if ($ip eq $ip) {
  40. print "ok $count\n";
  41. }
  42. else {
  43. print "not ok $count\n";
  44. }
  45. ++ $count;
  46.  
  47. if ($ip == $ip) {
  48. print "ok $count\n";
  49. }
  50. else {
  51. print "not ok $count\n";
  52. }
  53. ++ $count;
  54.  
  55. }