node_search_logic_test

AUTO-GENERATED FILE – DO NOT EDIT MANUALLY

Test suite for NodeSearchLogic pure logic class. Tests comprehensive node search functionality including:

  • Name-based node searching with exact and partial matches
  • Script-based searching by script file names
  • Group-based searching by group membership
  • Class-based searching by node class types
  • Property-based searching with custom property values
  • Method result-based searching with dynamic return values
  • Script name extraction and validation
  • Complex search result operations (combine, filter, sort)
  • Parameter validation for search operations Tests pure functions without complex object setup or dependencies.

Source File: /addons/grid_building/test/utilities/node_search/node_search_logic_test.gd

Extends: GdUnitTestSuite

Properties

  • Property: test_nodes: Array[Node]

Constants

  • Constant: TEST_NODE_1_NAME := "TestNode1" - Test constants to eliminate magic strings
  • Constant: TEST_NODE_2_NAME := "TestNode2"
  • Constant: TEST_NODE_3_NAME := "TestNode3"
  • Constant: TEST_NODE_PREFIX := "TestNode"
  • Constant: GROUP_A_NAME := "GroupA"
  • Constant: GROUP_B_NAME := "GroupB"
  • Constant: CUSTOM_PROPERTY_NAME := "custom_property"
  • Constant: TEST_METHOD_NAME := "test_method"
  • Constant: TEST_SCRIPT_SOURCE := "extends Node2D\nvar custom_property = null\nfunc test_method(): return null"
  • Constant: DYNAMIC_SCRIPT_TEMPLATE := "extends Node2D\nvar %s: Variant = null\nfunc %s() -> Variant: return %s"

Public Methods

before_test

1
before_test() -> void

after_test

1
after_test() -> void

test_combine_search_results

1
test_combine_search_results() -> void

Complex Operation Tests


test_filter_search_results

1
test_filter_search_results() -> void

test_sort_search_results

1
test_sort_search_results() -> void

Private Methods

_assert_search_result_count

1
2
3
4
5
_assert_search_result_count(
    found_nodes: Array[Node],
    expected_count: int,
    search_description: String
) -> void

Flags: private


_create_test_node_with_script

1
2
3
4
_create_test_node_with_script(
    node_name: String,
    add_script: bool = false
) -> Node2D

Flags: private



Grid Building v5.0.8 | Generated 24/05/2026