Skip to content

Commit 2fbbd90

Browse files
committed
get tests compiling again
1 parent 793e437 commit 2fbbd90

File tree

4 files changed

+44
-44
lines changed

4 files changed

+44
-44
lines changed

Sources/UnidocQueryTests/Tests/PackageQueries.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ struct PackageQueries:UnidocDatabaseTestBattery
9898
await tests.do
9999
{
100100
if let index:SearchIndexQuery<UnidocDatabase.Metadata>.Output = tests.expect(
101-
value: try await unidoc.execute(query: query, with: session)),
101+
value: try await session.query(database: unidoc.id, with: query)),
102102
let _:MD5 = tests.expect(value: index.hash)
103103
{
104104
switch index.json
@@ -130,7 +130,7 @@ struct PackageQueries:UnidocDatabaseTestBattery
130130
{
131131
guard
132132
let output:Unidoc.PackageQuery.Output = tests.expect(
133-
value: try await unidoc.execute(query: query, with: session))
133+
value: try await session.query(database: unidoc.id, with: query))
134134
else
135135
{
136136
return
@@ -149,7 +149,7 @@ struct PackageQueries:UnidocDatabaseTestBattery
149149
{
150150
guard
151151
let output:Unidoc.PackageQuery.Output = tests.expect(
152-
value: try await unidoc.execute(query: query, with: session))
152+
value: try await session.query(database: unidoc.id, with: query))
153153
else
154154
{
155155
return
@@ -176,7 +176,7 @@ struct PackageQueries:UnidocDatabaseTestBattery
176176
{
177177
guard
178178
let output:Unidoc.PackageQuery.Output = tests.expect(
179-
value: try await unidoc.execute(query: query, with: session))
179+
value: try await session.query(database: unidoc.id, with: query))
180180
else
181181
{
182182
return
@@ -201,7 +201,7 @@ struct PackageQueries:UnidocDatabaseTestBattery
201201
{
202202
guard
203203
let output:Unidoc.PackageQuery.Output = tests.expect(
204-
value: try await unidoc.execute(query: query, with: session))
204+
value: try await session.query(database: unidoc.id, with: query))
205205
else
206206
{
207207
return

Sources/UnidocQueryTests/Tests/SymbolQueries.TestCase.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ extension SymbolQueries
1212
let filters:Set<Filter>
1313
let members:[String]
1414
let nonmembers:[String]
15-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any>
15+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent>
1616
let tests:TestGroup
1717

1818
private
1919
init(
2020
filters:Set<Filter>,
2121
members:[String],
2222
nonmembers:[String],
23-
query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any>,
23+
query:Unidoc.VertexQuery<Unidoc.LookupAdjacent>,
2424
tests:TestGroup)
2525
{
2626
self.filters = filters
@@ -59,8 +59,8 @@ extension SymbolQueries.TestCase
5959
{
6060
await self.tests.do
6161
{
62-
if let output:Unidoc.VertexOutput<Any> = self.tests.expect(
63-
value: try await unidoc.execute(query: query, with: session)),
62+
if let output:Unidoc.VertexOutput = self.tests.expect(
63+
value: try await session.query(database: unidoc.id, with: self.query)),
6464
let _:Unidoc.Vertex = self.tests.expect(value: output.principal?.vertex)
6565
{
6666
let secondaries:[Unidoc.Scalar: Substring] = output.vertices.reduce(

Sources/UnidocQueryTests/Tests/SymbolQueries.swift

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ struct SymbolQueries:UnidocDatabaseTestBattery
7171
/// We should be able to resolve the ``Dictionary.Keys`` type without hashes.
7272
if let tests:TestGroup = tests / "Dictionary" / "Keys"
7373
{
74-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = .init(
74+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = .init(
7575
"swift", ["swift", "dictionary", "keys"])
7676
await tests.do
7777
{
7878

79-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
80-
value: try await unidoc.execute(query: query, with: session)),
79+
if let output:Unidoc.VertexOutput = tests.expect(
80+
value: try await session.query(database: unidoc.id, with: query)),
8181
let vertex:Unidoc.Vertex.Decl = tests.expect(
8282
value: output.principal?.vertex?.decl)
8383
{
@@ -89,13 +89,13 @@ struct SymbolQueries:UnidocDatabaseTestBattery
8989
/// We should be able to get multiple results back for an ambiguous query.
9090
if let tests:TestGroup = tests / "Int" / "init"
9191
{
92-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = .init(
92+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = .init(
9393
"swift", ["swift", "int.init(_:)"])
9494
await tests.do
9595
{
9696

97-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
98-
value: try await unidoc.execute(query: query, with: session)),
97+
if let output:Unidoc.VertexOutput = tests.expect(
98+
value: try await session.query(database: unidoc.id, with: query)),
9999
let principal:Unidoc.PrincipalOutput = tests.expect(
100100
value: output.principal),
101101
tests.expect(principal.matches.count >? 1),
@@ -108,14 +108,14 @@ struct SymbolQueries:UnidocDatabaseTestBattery
108108
/// We should be able to disambiguate the previous query with an FNV-1 hash.
109109
if let tests:TestGroup = tests / "Int" / "init" / "hashed"
110110
{
111-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = .init(
111+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = .init(
112112
"swift", ["swift", "int.init(_:)"],
113113
hash: .init("8VBWO"))
114114
await tests.do
115115
{
116116

117-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
118-
value: try await unidoc.execute(query: query, with: session)),
117+
if let output:Unidoc.VertexOutput = tests.expect(
118+
value: try await session.query(database: unidoc.id, with: query)),
119119
let principal:Unidoc.PrincipalOutput = tests.expect(
120120
value: output.principal),
121121
let _:Unidoc.Vertex = tests.expect(value: principal.vertex)
@@ -134,7 +134,7 @@ struct SymbolQueries:UnidocDatabaseTestBattery
134134
await tests.do
135135
{
136136
if let output:Unidoc.RedirectOutput = tests.expect(
137-
value: try await unidoc.execute(query: query, with: session)),
137+
value: try await session.query(database: unidoc.id, with: query)),
138138
let vertex:Unidoc.Vertex.Decl = tests.expect(
139139
value: output.matches.first?.decl)
140140
{
@@ -145,7 +145,7 @@ struct SymbolQueries:UnidocDatabaseTestBattery
145145

146146
if let tests:TestGroup = tests / "Parentheses"
147147
{
148-
for (name, query):(String, Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any>) in
148+
for (name, query):(String, Unidoc.VertexQuery<Unidoc.LookupAdjacent>) in
149149
[
150150
(
151151
"None",
@@ -159,16 +159,16 @@ struct SymbolQueries:UnidocDatabaseTestBattery
159159
{
160160
guard
161161
let tests:TestGroup = tests / name,
162-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = tests.expect(
162+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = tests.expect(
163163
value: query)
164164
else
165165
{
166166
continue
167167
}
168168
await tests.do
169169
{
170-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
171-
value: try await unidoc.execute(query: query, with: session)),
170+
if let output:Unidoc.VertexOutput = tests.expect(
171+
value: try await session.query(database: unidoc.id, with: query)),
172172
let _:Unidoc.Vertex = tests.expect(value: output.principal?.vertex)
173173
{
174174
}
@@ -178,12 +178,12 @@ struct SymbolQueries:UnidocDatabaseTestBattery
178178

179179
if let tests:TestGroup = tests / "BarbieCore"
180180
{
181-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = .init(
181+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = .init(
182182
"swift-malibu", ["barbiecore"])
183183
await tests.do
184184
{
185-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
186-
value: try await unidoc.execute(query: query, with: session)),
185+
if let output:Unidoc.VertexOutput = tests.expect(
186+
value: try await session.query(database: unidoc.id, with: query)),
187187
let vertex:Unidoc.Vertex.Culture = tests.expect(
188188
value: output.principal?.vertex?.culture),
189189
let tree:Unidoc.TypeTree = tests.expect(
@@ -208,12 +208,12 @@ struct SymbolQueries:UnidocDatabaseTestBattery
208208
/// namespace.
209209
if let tests:TestGroup = tests / "Barbie" / "Dreamhouse"
210210
{
211-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = .init(
211+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = .init(
212212
"swift-malibu", ["barbiecore", "barbie", "dreamhouse"])
213213
await tests.do
214214
{
215-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
216-
value: try await unidoc.execute(query: query, with: session)),
215+
if let output:Unidoc.VertexOutput = tests.expect(
216+
value: try await session.query(database: unidoc.id, with: query)),
217217
let vertex:Unidoc.Vertex = tests.expect(
218218
value: output.principal?.vertex),
219219
let tree:Unidoc.TypeTree = tests.expect(
@@ -274,13 +274,13 @@ struct SymbolQueries:UnidocDatabaseTestBattery
274274
/// into a hyphen.
275275
if let tests:TestGroup = tests / "Barbie" / "GettingStarted"
276276
{
277-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = .init(
277+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = .init(
278278
"swift-malibu", ["barbiecore", "getting-started"])
279279
await tests.do
280280
{
281281

282-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
283-
value: try await unidoc.execute(query: query, with: session)),
282+
if let output:Unidoc.VertexOutput = tests.expect(
283+
value: try await session.query(database: unidoc.id, with: query)),
284284
let _:Unidoc.Vertex = tests.expect(
285285
value: output.principal?.vertex)
286286
{

Sources/UnidocQueryTests/Tests/VolumeQueries.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ struct VolumeQueries:UnidocDatabaseTestBattery
4444
/// We should be able to resolve version 0.2.0 with a symbolic patch query.
4545
if let tests:TestGroup = tests / "LatestRelease"
4646
{
47-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = .init("\(package)", [])
47+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = .init("\(package)", [])
4848
await tests.do
4949
{
50-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
51-
value: try await unidoc.execute(query: query, with: session)),
50+
if let output:Unidoc.VertexOutput = tests.expect(
51+
value: try await session.query(database: unidoc.id, with: query)),
5252
let output:Unidoc.PrincipalOutput = tests.expect(value: output.principal)
5353
{
5454
tests.expect(output.volumeOfLatest?.patch ==? .v(0, 2, 0))
@@ -60,12 +60,12 @@ struct VolumeQueries:UnidocDatabaseTestBattery
6060
/// We should be able to resolve version 0.2.0 with a symbolic volume query.
6161
if let tests:TestGroup = tests / "CurrentRelease"
6262
{
63-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = .init(
63+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = .init(
6464
"\(package):0.2.0", [])
6565
await tests.do
6666
{
67-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
68-
value: try await unidoc.execute(query: query, with: session)),
67+
if let output:Unidoc.VertexOutput = tests.expect(
68+
value: try await session.query(database: unidoc.id, with: query)),
6969
let output:Unidoc.PrincipalOutput = tests.expect(value: output.principal)
7070
{
7171
tests.expect(output.volumeOfLatest?.patch ==? .v(0, 2, 0))
@@ -77,12 +77,12 @@ struct VolumeQueries:UnidocDatabaseTestBattery
7777
/// We should be able to resolve version 0.1.0 with a symbolic volume query.
7878
if let tests:TestGroup = tests / "OlderRelease"
7979
{
80-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = .init(
80+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = .init(
8181
"\(package):0.1.0", [])
8282
await tests.do
8383
{
84-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
85-
value: try await unidoc.execute(query: query, with: session)),
84+
if let output:Unidoc.VertexOutput = tests.expect(
85+
value: try await session.query(database: unidoc.id, with: query)),
8686
let output:Unidoc.PrincipalOutput = tests.expect(value: output.principal)
8787
{
8888
tests.expect(output.volumeOfLatest?.patch ==? .v(0, 2, 0))
@@ -94,12 +94,12 @@ struct VolumeQueries:UnidocDatabaseTestBattery
9494
/// We should be able to resolve version 1.0.0 with a symbolic volume query.
9595
if let tests:TestGroup = tests / "Prerelease"
9696
{
97-
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent, Any> = .init(
97+
let query:Unidoc.VertexQuery<Unidoc.LookupAdjacent> = .init(
9898
"\(package):1.0.0", [])
9999
await tests.do
100100
{
101-
if let output:Unidoc.VertexOutput<Any> = tests.expect(
102-
value: try await unidoc.execute(query: query, with: session)),
101+
if let output:Unidoc.VertexOutput = tests.expect(
102+
value: try await session.query(database: unidoc.id, with: query)),
103103
let output:Unidoc.PrincipalOutput = tests.expect(value: output.principal)
104104
{
105105
tests.expect(output.volumeOfLatest?.patch ==? .v(0, 2, 0))

0 commit comments

Comments
 (0)