Skip to content

Commit b4f8b0a

Browse files
test: add tests for unknown container definition
1 parent ef2bdc1 commit b4f8b0a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

test/functionality/slicing/pointer-analysis/container-single-index-based-access.test.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,33 @@ numbers <- other_numbers
311311
${acc('numbers', 1)} <- 1
312312
print(${acc('numbers', 1)})`
313313
);
314+
315+
assertSliced(
316+
label('When container has unknown definition and single index is read, then unknown definition is in slice'),
317+
shell,
318+
`numbers <- foo()
319+
${acc('numbers', 1)} <- 1
320+
${acc('numbers', 2)} <- 2
321+
print(${acc('numbers', 1)})`,
322+
['4@print'],
323+
`numbers <- foo()
324+
${acc('numbers', 1)} <- 1
325+
print(${acc('numbers', 1)})`,
326+
);
327+
328+
assertSliced(
329+
label('When container has unknown definition and container is read, then unknown definition is in slice'),
330+
shell,
331+
`numbers <- foo()
332+
${acc('numbers', 1)} <- 1
333+
${acc('numbers', 2)} <- 2
334+
print(numbers)`,
335+
['4@print'],
336+
`numbers <- foo()
337+
${acc('numbers', 1)} <- 1
338+
${acc('numbers', 2)} <- 2
339+
print(numbers)`,
340+
);
314341
});
315342
});
316343
}));

0 commit comments

Comments
 (0)