Skip to content

Commit

Permalink
redo codemarkup haskell tests
Browse files Browse the repository at this point in the history
Summary: These tests were using a precomputed hiedb as the test source. Migrated them to use the `glean/lang/haskell/tests/code` as the test source and generate the hiedb dynamically at test runtime

Reviewed By: malanka

Differential Revision: D62429900

fbshipit-source-id: 9138a82d9b7429028263f81986314c66b200b503
  • Loading branch information
Pepe Iborra authored and facebook-github-bot committed Sep 10, 2024
1 parent 8d71e99 commit e2349da
Show file tree
Hide file tree
Showing 13 changed files with 233 additions and 2,615 deletions.
596 changes: 12 additions & 584 deletions glean/lang/codemarkup/tests/haskell/cases/input_key/entity_location.out

Large diffs are not rendered by default.

115 changes: 105 additions & 10 deletions glean/lang/codemarkup/tests/haskell/cases/input_key/entity_uses.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
"hs": {
"definition": {
"key": {
"name": { "key": "Lib.Input.InputKey.fetchDefault" },
"name": { "key": "A.a" },
"source": {
"file": { "key": "Lib/Input/InputKey.hs" },
"span": { "start": 1518, "length": 12 }
"file": { "key": "fbcode/glean/lang/haskell/tests/code/A.hs" },
"span": { "start": 281, "length": 1 }
}
}
}
}
},
"file": { "key": "Lib/Input/InputKey.hs" },
"span": { "start": 1494, "length": 12 }
"file": { "key": "fbcode/glean/lang/haskell/tests/code/A.hs" },
"span": { "start": 228, "length": 1 }
}
},
{
Expand All @@ -25,17 +25,112 @@
"hs": {
"definition": {
"key": {
"name": { "key": "Lib.Input.InputKey.fetchDefault" },
"name": { "key": "A.a" },
"source": {
"file": { "key": "Lib/Input/InputKey.hs" },
"span": { "start": 1518, "length": 12 }
"file": { "key": "fbcode/glean/lang/haskell/tests/code/A.hs" },
"span": { "start": 281, "length": 1 }
}
}
}
}
},
"file": { "key": "Lib/Input/InputKey.hs" },
"span": { "start": 1518, "length": 12 }
"file": { "key": "fbcode/glean/lang/haskell/tests/code/A.hs" },
"span": { "start": 269, "length": 1 }
}
},
{
"key": {
"target": {
"hs": {
"definition": {
"key": {
"name": { "key": "A.a" },
"source": {
"file": { "key": "fbcode/glean/lang/haskell/tests/code/A.hs" },
"span": { "start": 281, "length": 1 }
}
}
}
}
},
"file": { "key": "fbcode/glean/lang/haskell/tests/code/A.hs" },
"span": { "start": 281, "length": 1 }
}
},
{
"key": {
"target": {
"hs": {
"definition": {
"key": {
"name": { "key": "A.a" },
"source": {
"file": { "key": "fbcode/glean/lang/haskell/tests/code/A.hs" },
"span": { "start": 281, "length": 1 }
}
}
}
}
},
"file": { "key": "fbcode/glean/lang/haskell/tests/code/B.hs" },
"span": { "start": 306, "length": 1 }
}
},
{
"key": {
"target": {
"hs": {
"definition": {
"key": {
"name": { "key": "B.b" },
"source": {
"file": { "key": "fbcode/glean/lang/haskell/tests/code/B.hs" },
"span": { "start": 284, "length": 1 }
}
}
}
}
},
"file": { "key": "fbcode/glean/lang/haskell/tests/code/B.hs" },
"span": { "start": 228, "length": 1 }
}
},
{
"key": {
"target": {
"hs": {
"definition": {
"key": {
"name": { "key": "B.b" },
"source": {
"file": { "key": "fbcode/glean/lang/haskell/tests/code/B.hs" },
"span": { "start": 284, "length": 1 }
}
}
}
}
},
"file": { "key": "fbcode/glean/lang/haskell/tests/code/B.hs" },
"span": { "start": 273, "length": 1 }
}
},
{
"key": {
"target": {
"hs": {
"definition": {
"key": {
"name": { "key": "B.b" },
"source": {
"file": { "key": "fbcode/glean/lang/haskell/tests/code/B.hs" },
"span": { "start": 284, "length": 1 }
}
}
}
}
},
"file": { "key": "fbcode/glean/lang/haskell/tests/code/B.hs" },
"span": { "start": 284, "length": 1 }
}
}
]
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
{
"@generated": null,
"hs.Definition.2": 1,
"hs.DefinitionName.1": 1,
"hs.TargetUses.2": 1
}
{ "@generated": null, "hs.TargetUses.2": 3 }
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
query: |
codemarkup.EntityUses {target = {hs = { definition = {name = "Lib.Input.InputKey.fetchDefault"}}}}
query: codemarkup.EntityUses _
perf: true
transform: [gensort, []]
Loading

0 comments on commit e2349da

Please sign in to comment.