diff options
author | Nobuyoshi Nakada <[email protected]> | 2024-12-30 17:04:09 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2024-12-30 17:04:09 +0900 |
commit | 5fec9308320e8b377681ef19b0cd46d53f94e8ac (patch) | |
tree | e88d605d5de8a7e0d67ff8368505bd431061ec2c | |
parent | 3650f2460f9f58ed188ad289cfb46a1d005d2538 (diff) |
[Bug #20992] Test for local variable name encodings
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12489
-rw-r--r-- | test/.excludes/TestVariable.rb | 3 | ||||
-rw-r--r-- | test/ruby/test_variable.rb | 7 |
2 files changed, 10 insertions, 0 deletions
diff --git a/test/.excludes/TestVariable.rb b/test/.excludes/TestVariable.rb new file mode 100644 index 0000000000..ecfbb0e3b8 --- /dev/null +++ b/test/.excludes/TestVariable.rb @@ -0,0 +1,3 @@ +if RUBY_DESCRIPTION.include?("+PRISM") + exclude(:test_local_variables_encoding, "[Bug #20992]") +end diff --git a/test/ruby/test_variable.rb b/test/ruby/test_variable.rb index 86f2e4bb84..49fec2d40e 100644 --- a/test/ruby/test_variable.rb +++ b/test/ruby/test_variable.rb @@ -425,6 +425,13 @@ class TestVariable < Test::Unit::TestCase end end + def test_local_variables_encoding + α = 1 + b = binding + b.eval("".encode("us-ascii")) + assert_equal(%i[α b], b.local_variables) + end + private def with_kwargs_11(v1:, v2:, v3:, v4:, v5:, v6:, v7:, v8:, v9:, v10:, v11:) local_variables |