summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDmytro Shyrshov <shirshov.dmitriy@gmail.com>2020-02-20 22:07:40 +0200
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2020-05-08 14:13:29 +0900
commit03fe7da186ff239a3cebaca3f2ce1e1c4b7d243f (patch)
tree61963d6f3cbce203b850c1fcb90d55eb569130b1 /test
parent7574b836a96fe4716ee40c920aa21ceb9530e733 (diff)
[rubygems/rubygems] Allow spaces in file headers during octal check
https://github.com/rubygems/rubygems/commit/e9e25731d8
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/3092
Diffstat (limited to 'test')
-rw-r--r--test/rubygems/test_gem_package_tar_header.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/rubygems/test_gem_package_tar_header.rb b/test/rubygems/test_gem_package_tar_header.rb
index 7e59073407..3629e6b685 100644
--- a/test/rubygems/test_gem_package_tar_header.rb
+++ b/test/rubygems/test_gem_package_tar_header.rb
@@ -205,4 +205,23 @@ tjmather\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
assert_equal 6932, tar_header.checksum
end
+ def test_spaces_in_headers
+ stream = StringIO.new(
+ <<-EOF.dup.force_encoding('binary').split("\n").join
+Access_Points_09202018.csv
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
+\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00
+\x00\x00100777 \x00 0 \x00 0 \x00 4357 13545040367 104501
+\x000
+ EOF
+ )
+
+ tar_header = Gem::Package::TarHeader.from stream
+
+ assert_equal 0, tar_header.uid
+ assert_equal 0, tar_header.gid
+ end
+
end