Skip to content

Commit 5fec930

Browse files
committed
[Bug #20992] Test for local variable name encodings
1 parent 3650f24 commit 5fec930

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

test/.excludes/TestVariable.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
if RUBY_DESCRIPTION.include?("+PRISM")
2+
exclude(:test_local_variables_encoding, "[Bug #20992]")
3+
end

test/ruby/test_variable.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,13 @@ def test_many_instance_variables
425425
end
426426
end
427427

428+
def test_local_variables_encoding
429+
α = 1
430+
b = binding
431+
b.eval("".encode("us-ascii"))
432+
assert_equal(%i[α b], b.local_variables)
433+
end
434+
428435
private
429436
def with_kwargs_11(v1:, v2:, v3:, v4:, v5:, v6:, v7:, v8:, v9:, v10:, v11:)
430437
local_variables

0 commit comments

Comments
 (0)