Skip to content

Commit b584d35

Browse files
committed
check if results are expected to be empty
1 parent 0702428 commit b584d35

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Sources/StructuredQueriesTestSupport/AssertQuery.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,22 @@ public func assertQuery<each V: QueryRepresentable, S: Statement<(repeat each V)
9797
line: line,
9898
column: column
9999
)
100+
} else if results != nil {
101+
assertInlineSnapshot(
102+
of: table,
103+
as: .lines,
104+
message: "Results expected to be empty",
105+
syntaxDescriptor: InlineSnapshotSyntaxDescriptor(
106+
trailingClosureLabel: "results",
107+
trailingClosureOffset: snapshotTrailingClosureOffset + 1
108+
),
109+
matches: results,
110+
fileID: fileID,
111+
file: filePath,
112+
function: function,
113+
line: line,
114+
column: column
115+
)
100116
}
101117
} catch {
102118
assertInlineSnapshot(

0 commit comments

Comments
 (0)