Sha256: e3cea1cb1a31e3c891692e6e1d395684e922fb63e474e5cc6601a742b4612a0b

Contents?: true

Size: 581 Bytes

Versions: 6

Compression:

Stored size: 581 Bytes

Contents

# -*- encoding: binary -*-
# Copyright (C) 2009-2016 all contributors <yahns-public@yhbt.net>
# License: GPL-3.0+ (https://www.gnu.org/licenses/gpl-2.0.txt)
# frozen_string_literal: true
require_relative 'helper'

class TestTmpIO < Testcase
  def test_writev
    a, b = UNIXSocket.pair
    a.extend Kgio::PipeMethods
    tmpio = Yahns::TmpIO.new(Dir.tmpdir)
    ary = [ "hello\n".freeze, "world\n".freeze ].freeze
    tmpio.kgio_trywritev(ary)
    a.trysendfile(tmpio, 0, 12)
    assert_equal "hello\nworld\n", b.read(12)
  ensure
    b.close
    a.close
    tmpio.close
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
yahns-1.12.5 test/test_tmpio.rb
yahns-1.12.4 test/test_tmpio.rb
yahns-1.12.3 test/test_tmpio.rb
yahns-1.12.2 test/test_tmpio.rb
yahns-1.12.1 test/test_tmpio.rb
yahns-1.12.0 test/test_tmpio.rb