8000 More tests by BurdetteLamar · Pull Request #9616 · ruby/ruby · GitHub
[go: up one dir, main page]

Skip to content

More tests #9616

New issue 8000

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
More tests
  • Loading branch information
BurdetteLamar committed Jan 19, 2024
commit e423ae28c9b1ec76f76a6f13b729cf05ad216917
36 changes: 36 additions & 0 deletions test/ruby/test_argf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1140,4 +1140,40 @@ def test_sized_read
argf.close
end
end

def test_putc
t = make_tempfile0("argf-#{__method__}")
t.puts 'bar'
t.close
ruby('-pi-', '-e', "print ARGF.putc('x')", t.path) do |f|
end
assert_equal("xxbar\n", File.read(t.path))
end

def test_puts
t = make_tempfile0("argf-#{__method__}")
t.puts 'bar'
t.close
ruby('-pi-', '-e', "print ARGF.puts('foo')", t.path) do |f|
end
assert_equal("foo\nbar\n", File.read(t.path))
end

def test_print
t = make_tempfile0("argf-#{__method__}")
t.puts 'bar'
t.close
ruby('-pi-', '-e', "print ARGF.print('foo')", t.path) do |f|
end
assert_equal("foobar\n", File.read(t.path))
end

def test_printf
t = make_tempfile0("argf-#{__method__}")
t.puts 'bar'
t.close
ruby('-pi-', '-e', "print ARGF.printf('%s', 'foo')", t.path) do |f|
end
assert_equal("foobar\n", File.read(t.path))
end
end
0