From c89e2fcc0cc2b35a9df63d5dbcb731bd3803f47f Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 23 Apr 2023 13:33:50 +0900 Subject: [PATCH 1/2] Remove an assigned but unused variable --- test/rbs/node_usage_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rbs/node_usage_test.rb b/test/rbs/node_usage_test.rb index eefc84f61..6e4ca4047 100644 --- a/test/rbs/node_usage_test.rb +++ b/test/rbs/node_usage_test.rb @@ -8,7 +8,7 @@ def parse(string) end def test_conditional - usage = NodeUsage.new(parse(<<~RB)) + NodeUsage.new(parse(<<~RB)) if block yield end From 884b3a6035c8451db0e714dccf21b02af2a0532a Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 23 Apr 2023 13:35:47 +0900 Subject: [PATCH 2/2] Adjust indent --- test/rbs/rb_prototype_test.rb | 44 +++++++++++++++++------------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/test/rbs/rb_prototype_test.rb b/test/rbs/rb_prototype_test.rb index cca256e82..d0955b754 100644 --- a/test/rbs/rb_prototype_test.rb +++ b/test/rbs/rb_prototype_test.rb @@ -234,36 +234,36 @@ def when_last_is_nil: () -> nil end def test_defs_return_type_with_block_optional - parser = RB.new + parser = RB.new - rb = <<~'EOR' - class Hello - def with_optional_block1 - # `block_given?` call makes the block optional - if block_given? - yield 1 - end + rb = <<~'EOR' + class Hello + def with_optional_block1 + # `block_given?` call makes the block optional + if block_given? + yield 1 end + end - def with_optional_block2(&block) - # testing block var makes the block optional - if block - yield 1 - end + def with_optional_block2(&block) + # testing block var makes the block optional + if block + yield 1 end end - EOR + end + EOR - parser.parse(rb) + parser.parse(rb) - assert_write parser.decls, <<~EOF - class Hello - def with_optional_block1: () ?{ (untyped) -> untyped } -> (untyped | nil) + assert_write parser.decls, <<~EOF + class Hello + def with_optional_block1: () ?{ (untyped) -> untyped } -> (untyped | nil) - def with_optional_block2: () ?{ (untyped) -> untyped } -> (untyped | nil) - end - EOF - end + def with_optional_block2: () ?{ (untyped) -> untyped } -> (untyped | nil) + end + EOF + end def test_defs_return_type_with_if parser = RB.new