MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / ensureMapEntry

Function ensureMapEntry

src/test/debug_helpers.ts:209–230  ·  view source on GitHub ↗
(mapEntries: DebugProtocol.Variable[], entry: MapEntry, dc: DartDebugClient)

Source from the content-addressed store, hash-verified

207}
208
209export async function ensureMapEntry(mapEntries: DebugProtocol.Variable[], entry: MapEntry, dc: DartDebugClient) {
210 assert.ok(mapEntries);
211 let found = false;
212 const keyValues: string[] = [];
213 await Promise.all(mapEntries.map(async (mapEntry) => {
214 const variable = await dc.getVariables(mapEntry.variablesReference);
215
216 const key = variable[0];
217 const value = variable[1];
218 assert.ok(key, "Didn't get Key variable");
219 assert.ok(value, "Didn't get Value variable");
220 if (key.name === entry.key.name
221 && key.value === entry.key.value
222 && key.evaluateName === entry.key.evaluateName
223 && value.evaluateName === entry.value.evaluateName
224 && value.name === entry.value.name
225 && value.value === entry.value.value)
226 found = true;
227 keyValues.push(`${key.value}=${value.value}`);
228 }));
229 assert.ok(found, `Didn't find map entry for ${entry.key.value}=${entry.value.value}\nGot:\n ${keyValues.join("\n ")})`);
230}
231
232export async function getVariablesTree(dc: DartDebugClient, variablesReference: number): Promise<string[]> {
233 let outputLines: string[] = [];

Calls 1

getVariablesMethod · 0.80

Tested by

no test coverage detected