Sha256: 433f22c79541d5dee1c1e888db2ee5818b476aade3f6849ac8552aaae0f47d97

Contents?: true

Size: 794 Bytes

Versions: 1

Compression:

Stored size: 794 Bytes

Contents

#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
# for lib/facets/core/string/unpack.rb
#
# Extracted Tue Jul 25 10:07:15 EDT 2006
# Unit Tools Reap Test Extractor
#

require 'facets/core/string/unpack.rb'


  require 'test/unit'

  class TCString < Test::Unit::TestCase

    def test_unpack
      str, fmt = "abc\0", "Z*"
      assert_equal "abc", str.unpack(fmt).first
      assert_equal "abc", str.unpack(fmt, 0).first
      assert_equal "bc", str.unpack(fmt, 1).first
      assert_equal "bc", str.unpack(fmt, -3).first
      assert_equal "c", str.unpack(fmt, 2).first
      assert_equal "c", str.unpack(fmt, -2).first
      assert_equal "", str.unpack(fmt, 3).first
      assert_equal "", str.unpack(fmt, -1).first
    end

  end


Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
facets-1.7.0 test/lib/facets/core/string/test_unpack.rb