Skip to content

Commit 2ed408d

Browse files
committed
[GR-14806] Update specs
PullRequest: truffleruby/3794
2 parents cd9bcad + 62bfbe5 commit 2ed408d

File tree

79 files changed

+970
-131
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+970
-131
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ src/main/c/etc/constdefs.h
5050
src/main/c/spawn-helper/spawn-helper
5151

5252
spec/ffi/.bundle/config
53+
spec/ffi/vendor/bundle
5354

5455
test/truffle/cexts/**/Makefile
5556

spec/mspec/lib/mspec/runner/mspec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,7 @@ def self.delete_tag(tag)
396396
desc = tag.escape(tag.description)
397397
file = tags_file
398398
if File.exist? file
399-
lines = IO.readlines(file)
399+
lines = File.readlines(file)
400400
File.open(file, "w:utf-8") do |f|
401401
lines.each do |line|
402402
line = line.chomp

spec/ruby/command_line/dash_v_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
it "prints version and ends" do
99
ruby_exe(nil, args: '-v').should include(RUBY_DESCRIPTION)
1010
end unless (defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?) ||
11-
(defined?(RubyVM::MJIT) && RubyVM::MJIT.enabled?)
11+
(defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?)
1212
end
1313
end
Binary file not shown.

spec/ruby/core/array/fixtures/classes.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,16 @@ def to_ary
160160
end
161161
end
162162

163+
class ArrayMethodMissing
164+
def initialize(*values, &block)
165+
@values = values;
166+
end
167+
168+
def method_missing(name, *args)
169+
@values
170+
end
171+
end
172+
163173
class SortSame
164174
def <=>(other); 0; end
165175
def ==(other); true; end

spec/ruby/core/array/pack/c_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@
4747

4848
ruby_version_is ""..."3.3" do
4949
it "ignores NULL bytes between directives" do
50-
[1, 2, 3].pack(pack_format("\000", 2)).should == "\x01\x02"
50+
suppress_warning do
51+
[1, 2, 3].pack(pack_format("\000", 2)).should == "\x01\x02"
52+
end
5153
end
5254
end
5355

spec/ruby/core/array/pack/shared/float.rb

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727

2828
ruby_version_is ""..."3.3" do
2929
it "ignores NULL bytes between directives" do
30-
[5.3, 9.2].pack(pack_format("\000", 2)).should == "\x9a\x99\xa9@33\x13A"
30+
suppress_warning do
31+
[5.3, 9.2].pack(pack_format("\000", 2)).should == "\x9a\x99\xa9@33\x13A"
32+
end
3133
end
3234
end
3335

@@ -105,7 +107,9 @@
105107

106108
ruby_version_is ""..."3.3" do
107109
it "ignores NULL bytes between directives" do
108-
[5.3, 9.2].pack(pack_format("\000", 2)).should == "@\xa9\x99\x9aA\x1333"
110+
suppress_warning do
111+
[5.3, 9.2].pack(pack_format("\000", 2)).should == "@\xa9\x99\x9aA\x1333"
112+
end
109113
end
110114
end
111115

@@ -175,7 +179,9 @@
175179

176180
ruby_version_is ""..."3.3" do
177181
it "ignores NULL bytes between directives" do
178-
[5.3, 9.2].pack(pack_format("\000", 2)).should == "333333\x15@ffffff\x22@"
182+
suppress_warning do
183+
[5.3, 9.2].pack(pack_format("\000", 2)).should == "333333\x15@ffffff\x22@"
184+
end
179185
end
180186
end
181187

@@ -244,7 +250,9 @@
244250

245251
ruby_version_is ""..."3.3" do
246252
it "ignores NULL bytes between directives" do
247-
[5.3, 9.2].pack(pack_format("\000", 2)).should == "@\x15333333@\x22ffffff"
253+
suppress_warning do
254+
[5.3, 9.2].pack(pack_format("\000", 2)).should == "@\x15333333@\x22ffffff"
255+
end
248256
end
249257
end
250258

spec/ruby/core/array/pack/shared/integer.rb

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@
4343

4444
ruby_version_is ""..."3.3" do
4545
it "ignores NULL bytes between directives" do
46-
str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
47-
str.should == "\x78\x65\xcd\xab"
46+
suppress_warning do
47+
str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
48+
str.should == "\x78\x65\xcd\xab"
49+
end
4850
end
4951
end
5052

@@ -105,8 +107,10 @@
105107

106108
ruby_version_is ""..."3.3" do
107109
it "ignores NULL bytes between directives" do
108-
str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
109-
str.should == "\x65\x78\xab\xcd"
110+
suppress_warning do
111+
str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
112+
str.should == "\x65\x78\xab\xcd"
113+
end
110114
end
111115
end
112116

@@ -167,8 +171,10 @@
167171

168172
ruby_version_is ""..."3.3" do
169173
it "ignores NULL bytes between directives" do
170-
str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
171-
str.should == "\x78\x65\x43\x12\xcd\xab\xf0\xde"
174+
suppress_warning do
175+
str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
176+
str.should == "\x78\x65\x43\x12\xcd\xab\xf0\xde"
177+
end
172178
end
173179
end
174180

@@ -229,8 +235,10 @@
229235

230236
ruby_version_is ""..."3.3" do
231237
it "ignores NULL bytes between directives" do
232-
str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
233-
str.should == "\x12\x43\x65\x78\xde\xf0\xab\xcd"
238+
suppress_warning do
239+
str = [0x1243_6578, 0xdef0_abcd].pack(pack_format("\000", 2))
240+
str.should == "\x12\x43\x65\x78\xde\xf0\xab\xcd"
241+
end
234242
end
235243
end
236244

@@ -351,8 +359,10 @@
351359

352360
ruby_version_is ""..."3.3" do
353361
it "ignores NULL bytes between directives" do
354-
str = [0xdef0_abcd_3412_7856, 0x7865_4321_dcba_def0].pack(pack_format("\000", 2))
355-
str.should == "\x56\x78\x12\x34\xcd\xab\xf0\xde\xf0\xde\xba\xdc\x21\x43\x65\x78"
362+
suppress_warning do
363+
str = [0xdef0_abcd_3412_7856, 0x7865_4321_dcba_def0].pack(pack_format("\000", 2))
364+
str.should == "\x56\x78\x12\x34\xcd\xab\xf0\xde\xf0\xde\xba\xdc\x21\x43\x65\x78"
365+
end
356366
end
357367
end
358368

@@ -421,8 +431,10 @@
421431

422432
ruby_version_is ""..."3.3" do
423433
it "ignores NULL bytes between directives" do
424-
str = [0xdef0_abcd_3412_7856, 0x7865_4321_dcba_def0].pack(pack_format("\000", 2))
425-
str.should == "\xde\xf0\xab\xcd\x34\x12\x78\x56\x78\x65\x43\x21\xdc\xba\xde\xf0"
434+
suppress_warning do
435+
str = [0xdef0_abcd_3412_7856, 0x7865_4321_dcba_def0].pack(pack_format("\000", 2))
436+
str.should == "\xde\xf0\xab\xcd\x34\x12\x78\x56\x78\x65\x43\x21\xdc\xba\xde\xf0"
437+
end
426438
end
427439
end
428440

spec/ruby/core/array/pack/shared/unicode.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@
6969

7070
ruby_version_is ""..."3.3" do
7171
it "ignores NULL bytes between directives" do
72-
[1, 2, 3].pack("U\x00U").should == "\x01\x02"
72+
suppress_warning do
73+
[1, 2, 3].pack("U\x00U").should == "\x01\x02"
74+
end
7375
end
7476
end
7577

spec/ruby/core/array/pack/w_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@
2626

2727
ruby_version_is ""..."3.3" do
2828
it "ignores NULL bytes between directives" do
29-
[1, 2, 3].pack("w\x00w").should == "\x01\x02"
29+
suppress_warning do
30+
[1, 2, 3].pack("w\x00w").should == "\x01\x02"
31+
end
3032
end
3133
end
3234

0 commit comments

Comments
 (0)