From 29713b7dad5b671ba3fdd24ddc49781918224540 Mon Sep 17 00:00:00 2001 From: Don Stewart Date: Tue, 3 Dec 2024 19:22:33 -0800 Subject: [PATCH] Move code.search tests under codemarkup/hack Summary: Looking at Hack now. Start by consolidating the search tests Reviewed By: simonmar Differential Revision: D66689693 fbshipit-source-id: 11cdda4d648fd7e700e7fa0416eab5f57dc405d6 --- .../codemarkup/tests/hack/search/.hhconfig | 7 + .../tests/hack/search/BaseModule.php | 4 + .../codemarkup/tests/hack/search/RefClass.php | 26 + .../tests/hack/search/SourceClass.php | 15 + .../tests/hack/search/SourceInterface.php | 10 + .../tests/hack/search/SourceTrait.php | 8 + .../tests/hack/search/SuperClass.php | 11 + .../codemarkup/tests/hack/search/TopLevel.php | 16 + .../hack/search/prefix_search_by_name.out | 472 ++++++++++++++++++ .../hack/search/prefix_search_by_name.perf | 20 + .../hack/search/prefix_search_by_name.query | 3 + .../prefix_search_function_in_namespace.out | 13 + .../prefix_search_function_in_namespace.perf | 9 + .../prefix_search_function_in_namespace.query | 6 + ...prefix_search_globalconst_in_namespace.out | 13 + ...refix_search_globalconst_in_namespace.perf | 9 + ...efix_search_globalconst_in_namespace.query | 6 + .../prefix_search_in_container_or_enum.out | 59 +++ .../prefix_search_in_container_or_enum.perf | 10 + .../prefix_search_in_container_or_enum.query | 5 + ...earch_in_container_or_enum_no_property.out | 45 ++ ...arch_in_container_or_enum_no_property.perf | 10 + ...rch_in_container_or_enum_no_property.query | 5 + .../search/prefix_search_in_namespace.out | 105 ++++ .../search/prefix_search_in_namespace.perf | 15 + .../search/prefix_search_in_namespace.query | 6 + .../prefix_search_type_in_namespace.out | 77 +++ .../prefix_search_type_in_namespace.perf | 12 + .../prefix_search_type_in_namespace.query | 6 + .../hack/search/search_by_lowercase_scope.out | 1 + .../search/search_by_lowercase_scope.perf | 5 + .../search/search_by_lowercase_scope.query | 3 + .../tests/hack/search/search_by_name.out | 43 ++ .../tests/hack/search/search_by_name.perf | 5 + .../tests/hack/search/search_by_name.query | 3 + .../tests/hack/search/search_by_scope.out | 28 ++ .../tests/hack/search/search_by_scope.perf | 10 + .../tests/hack/search/search_by_scope.query | 3 + .../search/search_by_scope_class_const.out | 28 ++ .../search/search_by_scope_class_const.perf | 10 + .../search/search_by_scope_class_const.query | 3 + .../hack/search/search_by_scope_enum.out | 26 + .../hack/search/search_by_scope_enum.perf | 10 + .../hack/search/search_by_scope_enum.query | 3 + .../hack/search/search_by_scope_interface.out | 30 ++ .../search/search_by_scope_interface.perf | 10 + .../search/search_by_scope_interface.query | 3 + .../search_by_scope_interface_method.out | 30 ++ .../search_by_scope_interface_method.perf | 10 + .../search_by_scope_interface_method.query | 3 + .../hack/search/search_by_scope_method.out | 28 ++ .../hack/search/search_by_scope_method.perf | 10 + .../hack/search/search_by_scope_method.query | 3 + .../hack/search/search_by_scope_module.out | 15 + .../hack/search/search_by_scope_module.perf | 5 + .../hack/search/search_by_scope_module.query | 3 + .../hack/search/search_by_scope_property.out | 28 ++ .../hack/search/search_by_scope_property.perf | 10 + .../search/search_by_scope_property.query | 3 + .../hack/search/search_by_scope_super.out | 28 ++ .../hack/search/search_by_scope_super.perf | 10 + .../hack/search/search_by_scope_super.query | 3 + .../hack/search/search_by_scope_trait.out | 28 ++ .../hack/search/search_by_scope_trait.perf | 10 + .../hack/search/search_by_scope_trait.query | 3 + .../search/search_by_scope_type_const.out | 28 ++ .../search/search_by_scope_type_const.perf | 10 + .../search/search_by_scope_type_const.query | 3 + .../search/search_function_in_namespace.out | 13 + .../search/search_function_in_namespace.perf | 5 + .../search/search_function_in_namespace.query | 3 + .../search_globalconst_in_namespace.out | 13 + .../search_globalconst_in_namespace.perf | 5 + .../search_globalconst_in_namespace.query | 3 + .../search/search_in_container_or_enum.out | 17 + .../search/search_in_container_or_enum.perf | 10 + .../search/search_in_container_or_enum.query | 5 + ...earch_in_container_or_enum_no_property.out | 45 ++ ...arch_in_container_or_enum_no_property.perf | 10 + ...rch_in_container_or_enum_no_property.query | 5 + .../tests/hack/search/search_in_context.out | 23 + .../tests/hack/search/search_in_context.perf | 10 + .../tests/hack/search/search_in_context.query | 3 + .../hack/search/search_in_context_const.out | 23 + .../hack/search/search_in_context_const.perf | 10 + .../hack/search/search_in_context_const.query | 3 + .../hack/search/search_in_context_enum.out | 19 + .../hack/search/search_in_context_enum.perf | 10 + .../hack/search/search_in_context_enum.query | 3 + .../search/search_in_context_interface.out | 23 + .../search/search_in_context_interface.perf | 10 + .../search/search_in_context_interface.query | 3 + .../tests/hack/search/search_in_namespace.out | 1 + .../hack/search/search_in_namespace.perf | 5 + .../hack/search/search_in_namespace.query | 6 + .../hack/search/search_type_in_namespace.out | 77 +++ .../hack/search/search_type_in_namespace.perf | 11 + .../search/search_type_in_namespace.query | 3 + 98 files changed, 1875 insertions(+) create mode 100644 glean/lang/codemarkup/tests/hack/search/.hhconfig create mode 100644 glean/lang/codemarkup/tests/hack/search/BaseModule.php create mode 100644 glean/lang/codemarkup/tests/hack/search/RefClass.php create mode 100644 glean/lang/codemarkup/tests/hack/search/SourceClass.php create mode 100644 glean/lang/codemarkup/tests/hack/search/SourceInterface.php create mode 100644 glean/lang/codemarkup/tests/hack/search/SourceTrait.php create mode 100644 glean/lang/codemarkup/tests/hack/search/SuperClass.php create mode 100644 glean/lang/codemarkup/tests/hack/search/TopLevel.php create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_by_name.out create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_by_name.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_by_name.query create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_function_in_namespace.out create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_function_in_namespace.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_function_in_namespace.query create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_globalconst_in_namespace.out create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_globalconst_in_namespace.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_globalconst_in_namespace.query create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_in_container_or_enum.out create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_in_container_or_enum.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_in_container_or_enum.query create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_in_container_or_enum_no_property.out create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_in_container_or_enum_no_property.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_in_container_or_enum_no_property.query create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_in_namespace.out create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_in_namespace.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_in_namespace.query create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_type_in_namespace.out create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_type_in_namespace.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/prefix_search_type_in_namespace.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_lowercase_scope.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_lowercase_scope.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_lowercase_scope.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_name.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_name.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_name.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_class_const.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_class_const.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_class_const.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_enum.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_enum.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_enum.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_interface.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_interface.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_interface.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_interface_method.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_interface_method.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_interface_method.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_method.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_method.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_method.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_module.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_module.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_module.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_property.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_property.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_property.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_super.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_super.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_super.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_trait.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_trait.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_trait.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_type_const.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_type_const.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_by_scope_type_const.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_function_in_namespace.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_function_in_namespace.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_function_in_namespace.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_globalconst_in_namespace.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_globalconst_in_namespace.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_globalconst_in_namespace.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_container_or_enum.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_container_or_enum.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_container_or_enum.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_container_or_enum_no_property.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_container_or_enum_no_property.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_container_or_enum_no_property.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context_const.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context_const.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context_const.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context_enum.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context_enum.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context_enum.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context_interface.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context_interface.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_context_interface.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_namespace.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_namespace.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_in_namespace.query create mode 100644 glean/lang/codemarkup/tests/hack/search/search_type_in_namespace.out create mode 100644 glean/lang/codemarkup/tests/hack/search/search_type_in_namespace.perf create mode 100644 glean/lang/codemarkup/tests/hack/search/search_type_in_namespace.query diff --git a/glean/lang/codemarkup/tests/hack/search/.hhconfig b/glean/lang/codemarkup/tests/hack/search/.hhconfig new file mode 100644 index 000000000..ed1d32994 --- /dev/null +++ b/glean/lang/codemarkup/tests/hack/search/.hhconfig @@ -0,0 +1,7 @@ +# some comment +assume_php = false + +allowed_fixme_codes_strict = 4110 +allowed_decl_fixme_codes = 4110 + +auto_namespace_map = {"Herp": "Derp\\Lib\\Herp"} diff --git a/glean/lang/codemarkup/tests/hack/search/BaseModule.php b/glean/lang/codemarkup/tests/hack/search/BaseModule.php new file mode 100644 index 000000000..465251b66 --- /dev/null +++ b/glean/lang/codemarkup/tests/hack/search/BaseModule.php @@ -0,0 +1,4 @@ +daz + $this::JAZZ + WALDO; + $result2 = $this->quux($result1) + Position::Right + $this::foo(); + $result3 = $this->raz + $this->bazza() + SourceClass::superAdd(1, $param); + return ($result1 + $result2 + $result3 + Position::Center) * corge(); + } +} diff --git a/glean/lang/codemarkup/tests/hack/search/SourceClass.php b/glean/lang/codemarkup/tests/hack/search/SourceClass.php new file mode 100644 index 000000000..dcbf9ecd4 --- /dev/null +++ b/glean/lang/codemarkup/tests/hack/search/SourceClass.php @@ -0,0 +1,15 @@ +