File: ipaddress_test.rb

package info (click to toggle)
ruby-citrus 3.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 420 kB
  • sloc: ruby: 3,417; makefile: 5
file content (18 lines) | stat: -rw-r--r-- 380 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require File.expand_path('../../helper', __FILE__)
require 'citrus/grammars'

Citrus.require 'ipaddress'

class IPAddressTest < Test::Unit::TestCase
  def test_v4
    match = IPAddress.parse('1.2.3.4')
    assert(match)
    assert_equal(4, match.version)
  end

  def test_v6
    match = IPAddress.parse('1:2:3:4::')
    assert(match)
    assert_equal(6, match.version)
  end
end