Sha256: dd183b12d965a60bf4b20a48b56e737b4fa076b52cf3c9a064ec77f84b7cf8af

Contents?: true

Size: 544 Bytes

Versions: 1

Compression:

Stored size: 544 Bytes

Contents

require 'test/unit'
require "#{File.dirname(__FILE__)}/../../lib/bencode.rb"

class BdecodeListTest < Test::Unit::TestCase
  def test_empty
    assert_equal [], 'le'.bdecode
  end

  def test_string_list
    assert_equal %w[foo], 'l3:fooe'.bdecode
    assert_equal %w[a b c], 'l1:a1:b1:ce'.bdecode
  end

  def test_integer_list
    assert_equal [0], 'li0ee'.bdecode
    assert_equal [1, 2, 3], 'li1ei2ei3ee'.bdecode
  end

  def test_list_list
    assert_equal [[]], 'llee'.bdecode
    assert_equal [[], [], []], 'llelelee'.bdecode
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
bencode-0.5.0 test/decode/test_list.rb