From 01d8bcd50490121a30d4f5f222140b7990900c65 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Sat, 26 Oct 2024 06:11:11 -0700 Subject: [PATCH] Add a regression test Summary: This query (or one like it) regressed with an earlier version of the changes to reordering, so adding a regresion test for it. Reviewed By: phlalx Differential Revision: D64835638 fbshipit-source-id: ea16cb036a5288b8461e090587b8eac225952074 --- .../hack/cases/xrefs/declarationnamespace.out | 23 +++++++++++++ .../cases/xrefs/declarationnamespace.perf | 8 +++++ .../cases/xrefs/declarationnamespace.query | 33 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.out create mode 100644 glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.perf create mode 100644 glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.query diff --git a/glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.out b/glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.out new file mode 100644 index 000000000..98132eca3 --- /dev/null +++ b/glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.out @@ -0,0 +1,23 @@ +[ + "@generated", + { + "key": { + "declaration": { + "method": { + "key": { + "name": { "key": "bar" }, + "container": { + "class_": { + "key": { + "name": { "key": { "name": { "key": "SourceClass" } } } + } + } + } + } + } + }, + "file": { "key": "www/SourceClass.php" }, + "span": { "start": 408, "length": 3 } + } + } +] \ No newline at end of file diff --git a/glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.perf b/glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.perf new file mode 100644 index 000000000..602582a92 --- /dev/null +++ b/glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.perf @@ -0,0 +1,8 @@ +{ + "@generated": null, + "hack.ClassDeclaration.6": 1, + "hack.DeclarationLocation.6": 1, + "hack.MethodDeclaration.6": 1, + "hack.Name.6": 6, + "hack.QName.6": 3 +} \ No newline at end of file diff --git a/glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.query b/glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.query new file mode 100644 index 000000000..0e0d9fe64 --- /dev/null +++ b/glean/lang/codemarkup/tests/hack/cases/xrefs/declarationnamespace.query @@ -0,0 +1,33 @@ +query: | + hack.DeclarationLocation + { + declaration = { + method = hack.MethodDeclaration.6 { + name="bar", + container = { + class_ = hack.ClassDeclaration.6 { + name = hack.QName.6 { + name = "SourceClass", + namespace_ = {nothing={}} + } + } + } | { + interface_ = hack.InterfaceDeclaration.6 { + name=hack.QName.6 { + name = "SourceClass", + namespace_={nothing={}} + } + } + } | { + trait = hack.TraitDeclaration.6 { + name = hack.QName.6 { + name = "SourceClass", + namespace_ = {nothing={}} + } + } + } + } + } + } +perf: true +transform: [gensort, []]