From 16a4b38db8c2bcae895487c3098597156f3a2f0c Mon Sep 17 00:00:00 2001 From: Pawel Lampe Date: Thu, 31 Oct 2024 12:12:54 +0100 Subject: [PATCH] WIP --- REPRO | 1 + .../bug_340_lambda_corner_case.in.gd | 10 ++++++++++ .../bug_340_lambda_corner_case.out.gd | 7 +++++++ 3 files changed, 18 insertions(+) create mode 100644 REPRO create mode 100644 tests/formatter/input-output-pairs/bug_340_lambda_corner_case.in.gd create mode 100644 tests/formatter/input-output-pairs/bug_340_lambda_corner_case.out.gd diff --git a/REPRO b/REPRO new file mode 100644 index 0000000..b883552 --- /dev/null +++ b/REPRO @@ -0,0 +1 @@ +tox -e py3 -- -k 'test_parsing_success[/asdf/Gamedev/godot-related/godot-gdscript-toolkit/tests/parser/../formatter/input-output-pairs/bug_340_lambda_corner_case.in.gd]' diff --git a/tests/formatter/input-output-pairs/bug_340_lambda_corner_case.in.gd b/tests/formatter/input-output-pairs/bug_340_lambda_corner_case.in.gd new file mode 100644 index 0000000..8ba8aa8 --- /dev/null +++ b/tests/formatter/input-output-pairs/bug_340_lambda_corner_case.in.gd @@ -0,0 +1,10 @@ +extends Node + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + + var reports: = [] + var test_report: int = reports.filter(func (value: int) -> bool: + return value == 42 + ).back() diff --git a/tests/formatter/input-output-pairs/bug_340_lambda_corner_case.out.gd b/tests/formatter/input-output-pairs/bug_340_lambda_corner_case.out.gd new file mode 100644 index 0000000..f26a2f8 --- /dev/null +++ b/tests/formatter/input-output-pairs/bug_340_lambda_corner_case.out.gd @@ -0,0 +1,7 @@ +extends Node + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + var reports := [] + var test_report: int = reports.filter(func(value: int) -> bool: return value == 42).back()