Skip to content

Commit e18c129

Browse files
test: assure that pointer analysis is enabled in each describe block
1 parent 142e42d commit e18c129

File tree

3 files changed

+27
-14
lines changed

3 files changed

+27
-14
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe.sequential('Container Single Index Based Access', withShell(shell => {
3333
beforeAll(() => {
3434
amendConfig({ solver: { ...defaultConfigOptions.solver, pointerTracking: true } });
3535
});
36-
36+
3737
afterAll(() => {
3838
amendConfig({ solver: { ...defaultConfigOptions.solver, pointerTracking: false } });
3939
});
@@ -78,7 +78,7 @@ describe.sequential('Container Single Index Based Access', withShell(shell => {
7878
resolveIdsAsCriterion: true,
7979
}
8080
);
81-
81+
8282
assertDataflow(
8383
label('When single unnamed flattened list index is accessed, then access reads index', basicCapabilities),
8484
shell,

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

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ describe.sequential('Container Single Index Based Access', withShell(shell => {
2828
useConfigForTest({ solver: { pointerTracking: true } });
2929

3030
describe('Simple access', () => {
31+
useConfigForTest({ solver: { pointerTracking: true } });
32+
3133
assertSliced(
3234
label('Container with single argument', basicCapabilities),
3335
shell,
@@ -51,6 +53,8 @@ print(${acc('numbers', 1)})`,
5153
});
5254

5355
describe('Whole container access', () => {
56+
useConfigForTest({ solver: { pointerTracking: true } });
57+
5458
assertSliced(
5559
label('When each argument of a container is redefined, then original container is still in slice', basicCapabilities),
5660
shell,
@@ -106,6 +110,8 @@ print(numbers)`
106110
});
107111

108112
describe('Access with other accesses', () => {
113+
useConfigForTest({ solver: { pointerTracking: true } });
114+
109115
assertSliced(
110116
label('With other container', basicCapabilities),
111117
shell,
@@ -132,6 +138,8 @@ print(${acc('numbers', 1)})`,
132138
});
133139

134140
describe('Access with assignment', () => {
141+
useConfigForTest({ solver: { pointerTracking: true } });
142+
135143
assertSliced(
136144
label('When there is more than one assignment to the same index, then the last assignment is in the slice', basicCapabilities),
137145
shell,
@@ -208,6 +216,7 @@ print(${acc('numbers', 1)})`
208216

209217
describe('Config flag', () => {
210218
useConfigForTest({ solver: { pointerTracking: false } });
219+
211220
assertSliced(
212221
label('When flag is false, then container access is not in slice', ['call-normal']),
213222
shell,
@@ -224,6 +233,8 @@ print(${acc('numbers', 1)})`
224233
});
225234

226235
describe('Container assignment', () => {
236+
useConfigForTest({ solver: { pointerTracking: true } });
237+
227238
assertSliced(
228239
label('When container is self-redefined, then indices get passed', basicCapabilities),
229240
shell,
@@ -311,12 +322,14 @@ print(numbers)`,
311322
${acc('numbers', 1)} <- 1
312323
${acc('numbers', 2)} <- 2
313324
print(numbers)`,
325+
undefined,
326+
'fail-both',
314327
);
315328
});
316329

317330
describe.skipIf(container !== ContainerType.List)('Nested Lists', () => {
318331
useConfigForTest({ solver: { pointerTracking: true } });
319-
332+
320333
assertSliced(
321334
label('When index of nested list is overwritten, then overwrite is also in slice', basicCapabilities),
322335
shell,
@@ -352,7 +365,7 @@ person <- ${def('24', '"John"', '164', 'FALSE', 'grades')}
352365
${acc(acc('person', 5), 1)} <- 4.0
353366
result <- ${acc(acc('person', 5), 1)}`,
354367
);
355-
368+
356369
assertSliced(
357370
label('When nested list is overwritten, then only overwrite list is in slice', basicCapabilities),
358371
shell,
@@ -371,7 +384,7 @@ ${acc('grades', 2)} <- 2.0
371384
person <- ${def('24', '"John"', '164', 'FALSE', 'grades')}
372385
result <- ${acc(acc('person', 5), 2)}`,
373386
);
374-
387+
375388
assertSliced(
376389
label('When nested list is overwritten after nesting, then only overwrite list is in slice', basicCapabilities),
377390
shell,
@@ -389,7 +402,7 @@ person <- ${def('24', '"John"', '164', 'FALSE', 'grades')}
389402
${acc('person', 5)} <- ${def('4.0', '3.0')}
390403
result <- ${acc(acc('person', 5), 2)}`,
391404
);
392-
405+
393406
assertSliced(
394407
label('When nested list is accessed, then accesses to nested list are in slice', basicCapabilities),
395408
shell,
@@ -407,7 +420,7 @@ ${acc('grades', 4)} <- 1.0
407420
person <- ${def('"John"', 'grades')}
408421
result <- ${acc('person', 2)}`,
409422
);
410-
423+
411424
assertSliced(
412425
label('When nested list is accessed, then accesses to nested lists are in slice', basicCapabilities),
413426
shell,
@@ -426,7 +439,7 @@ ${acc('grades', 2)} <- 1.0
426439
person <- ${def('"John"', 'grades')}
427440
result <- ${acc('person', 2)}`,
428441
);
429-
442+
430443
assertSliced(
431444
label('When double nested list is accessed, then accesses to nested lists are in slice', basicCapabilities),
432445
shell,
@@ -444,7 +457,7 @@ grades <- ${def('algebra_grades', '1.7')}
444457
person <- ${def('"John"', 'grades')}
445458
result <- ${acc(acc('person', 2), 1)}`,
446459
);
447-
460+
448461
assertSliced(
449462
label('When list is assigned, then accesses to list and nested lists are in slice', basicCapabilities),
450463
shell,
@@ -466,7 +479,7 @@ result <- person`,
466479
undefined,
467480
'fail-both',
468481
);
469-
482+
470483
assertSliced(
471484
label('When nested list is redefined twice, then only second redefinition is in slice', basicCapabilities),
472485
shell,
@@ -489,7 +502,7 @@ result <- ${acc(acc('person', 5), 2)}`,
489502
undefined,
490503
'fail-both',
491504
);
492-
505+
493506
assertSliced(
494507
label('When nested list is redefined with static value, then only static value assignment is in slice', basicCapabilities),
495508
shell,
@@ -510,7 +523,7 @@ result <- ${acc('person', 5)}`,
510523
undefined,
511524
'fail-both',
512525
);
513-
526+
514527
assertSliced(
515528
label('When static list value is redefined with list, then only list value assignment is in slice', basicCapabilities),
516529
shell,
@@ -563,7 +576,7 @@ if(u) ${acc('person', 2)} <- "peter"
563576
wrapper <- ${def('person')}
564577
print(${acc(acc('wrapper', 1), 2)})`,
565578
);
566-
579+
567580
//Currently we can not handle the indirect passing minimally and include the name line
568581
assertSliced(
569582
label('Potential addition in nesting (not needed)', basicCapabilities),

test/functionality/slicing/pointer-analysis/special-cases.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { useConfigForTest } from '../../_helper/config';
66
// Tests that cannot be generalized and are not covered by other tests
77
describe.sequential('Special Cases', withShell(shell => {
88
useConfigForTest({ solver: { pointerTracking: true } });
9-
9+
1010
assertSliced(
1111
label('When multiple indices are accessed with unknown access operator, then all indices are in slice', ['name-normal', 'function-calls', 'named-arguments', 'unnamed-arguments', 'subsetting-multiple', 'single-bracket-access', 'dollar-access']),
1212
shell,

0 commit comments

Comments
 (0)