Skip to content

Commit

Permalink
test(list-access): add supported capabilities ids to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Slartibartfass2 committed Jan 2, 2025
1 parent edbab1d commit 98b12f0
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions test/functionality/slicing/pointer-analysis/list-access.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { label } from '../../_helper/label';
describe.sequential('List access', withShell(shell => {
describe('Simple access', () => {
assertSliced(
label('List with single element', []), shell,
label('List with single element', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']), shell,
`person <- list(name = "John")
result <- person$name`,
['2@result'],
Expand All @@ -14,7 +14,7 @@ result <- person$name`,
);

assertSliced(
label('List with several elements', []), shell,
label('List with several elements', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']), shell,
`person <- list(name = "John", age = 24, is_male = TRUE)
result <- person$name`,
['2@result'],
Expand All @@ -25,7 +25,7 @@ result <- person$name`,

describe('Whole list access', () => {
assertSliced(
label('When each argument of a list is redefined, then original list is still in slice', []), shell,
label('When each argument of a list is redefined, then original list is still in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']), shell,
`person <- list(age = 24, name = "John", is_male = TRUE)
person$is_male <- FALSE
person$name <- "Alice"
Expand All @@ -40,7 +40,7 @@ result <- person`
);

assertSliced(
label('When arguments are added to an empty list, then original list is in slice', []), shell,
label('When arguments are added to an empty list, then original list is in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']), shell,
`person <- list()
person$is_male <- FALSE
person$name <- "Alice"
Expand All @@ -55,7 +55,7 @@ result <- person`
);

assertSliced(
label('When whole list is redefined, then every list assignment before is not in slice', []), shell,
label('When whole list is redefined, then every list assignment before is not in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']), shell,
`person <- list(age = 24, name = "John")
person$age <- 33
person$name <- "Jane"
Expand All @@ -73,7 +73,7 @@ result <- person`

describe('Access with other accesses', () => {
assertSliced(
label('With other list', []), shell,
label('With other list', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']), shell,
`person <- list(age = 24, name = "John")
other_person <- list(age = 24, name = "John")
a <- other_person$name
Expand All @@ -84,7 +84,7 @@ result <- person$name`,
);

assertSliced(
label('With other accesses', []), shell,
label('With other accesses', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']), shell,
`person <- list(age = 24, name = "John", is_male = TRUE)
a <- person$age
b <- person$is_male
Expand All @@ -97,7 +97,7 @@ result <- person$age`,

describe('Access with assignment', () => {
assertSliced(
label('When there is more than one assignment to the same index, then the last assignment is in the slice', []),
label('When there is more than one assignment to the same index, then the last assignment is in the slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`person <- list(age = 24, name = "John")
person$name <- "Bob"
Expand All @@ -111,7 +111,7 @@ result <- person$name`,
);

assertSliced(
label('When there are assignments to the other indices, then they are not in the slice', []),
label('When there are assignments to the other indices, then they are not in the slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`person <- list(age = 24, name = "John", is_male = TRUE)
person$is_male <- FALSE
Expand All @@ -125,7 +125,7 @@ result <- person$name`,
);

assertSliced(
label('When there are assignments to only other indices, then only list is in the slice', []),
label('When there are assignments to only other indices, then only list is in the slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`person <- list(age = 24, name = "John", is_male = TRUE)
person$is_male <- FALSE
Expand All @@ -139,7 +139,7 @@ result <- person$age`,

describe('Nested lists', () => {
assertSliced(
label('When index of nested list is overwritten, then overwrite is also in slice', []),
label('When index of nested list is overwritten, then overwrite is also in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`grades <- list(algebra = 1.3, german = 2.0, english = 2.3, sports = 1.7)
grades$algebra <- 1.0
Expand All @@ -156,7 +156,7 @@ result <- person$grades$algebra`,
);

assertSliced(
label('When index of nested list is overwritten after nesting, then overwrite is also in slice', []),
label('When index of nested list is overwritten after nesting, then overwrite is also in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`grades <- list(algebra = 1.3, german = 2.0, english = 2.3, sports = 1.7)
grades$algebra <- 1.0
Expand All @@ -175,7 +175,7 @@ result <- person$grades$algebra`,
);

assertSliced(
label('When nested list is overwritten, then only overwrite list is in slice', []),
label('When nested list is overwritten, then only overwrite list is in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`grades <- list(algebra = 1.3, german = 2.0, english = 2.3, sports = 1.7)
grades$algebra <- 1.0
Expand All @@ -194,7 +194,7 @@ result <- person$grades$music`,
);

assertSliced(
label('When nested list is overwritten after nesting, then only overwrite list is in slice', []),
label('When nested list is overwritten after nesting, then only overwrite list is in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`grades <- list(algebra = 1.3, german = 2.0, english = 2.3, sports = 1.7)
grades$algebra <- 1.0
Expand All @@ -212,7 +212,7 @@ result <- person$grades$music`,
);

assertSliced(
label('When nested list is accessed, then accesses to nested list are in slice', []),
label('When nested list is accessed, then accesses to nested list are in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`grades <- list(algebra = 1.3, sports = 1.7)
grades$algebra <- 1.0
Expand All @@ -230,7 +230,7 @@ result <- person$grades`,
);

assertSliced(
label('When nested list is accessed, then accesses to nested lists are in slice', []),
label('When nested list is accessed, then accesses to nested lists are in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`algebra_grades <- list(test = 1.0, exam = 3.0)
algebra_grades$test <- 4.0
Expand All @@ -249,7 +249,7 @@ result <- person$grades`,
);

assertSliced(
label('When double nested list is accessed, then accesses to nested lists are in slice', []),
label('When double nested list is accessed, then accesses to nested lists are in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`algebra_grades <- list(test = 1.0, exam = 3.0)
algebra_grades$test <- 4.0
Expand All @@ -268,7 +268,7 @@ result <- person$grades$algebra`,

it.fails('When list is assigned, then accesses to list and nested lists are in slice', () => {
assertSliced(
label('When list is assigned, then accesses to list and nested lists are in slice', []),
label('When list is assigned, then accesses to list and nested lists are in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`algebra_grades <- list(test = 1.0, exam = 3.0)
algebra_grades$test <- 4.0
Expand All @@ -290,7 +290,7 @@ result <- person`,

it.fails('When nested list is redefined twice, then only second redefinition is in slice', () => {
assertSliced(
label('When nested list is redefined twice, then only second redefinition is in slice', []),
label('When nested list is redefined twice, then only second redefinition is in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`grades <- list(algebra = 1.3, german = 2.0, english = 2.3, sports = 1.7)
grades$algebra <- 1.0
Expand All @@ -313,7 +313,7 @@ result <- person$grades$music`,

it.fails('When nested list is redefined with static value, then only static value assignment is in slice', () => {
assertSliced(
label('When nested list is redefined with static value, then only static value assignment is in slice', []),
label('When nested list is redefined with static value, then only static value assignment is in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`grades <- list(algebra = 1.3, german = 2.0, english = 2.3, sports = 1.7)
grades$algebra <- 1.0
Expand All @@ -334,7 +334,7 @@ result <- person$grades`,

it.fails('When static list value is redefined with list, then only list value assignment is in slice', () => {
assertSliced(
label('When static list value is redefined with list, then only list value assignment is in slice', []),
label('When static list value is redefined with list, then only list value assignment is in slice', ['name-normal', 'function-calls', 'named-arguments', 'dollar-access', 'subsetting']),
shell,
`grades <- list(algebra = 1.3, german = 2.0, english = 2.3, sports = 1.7)
grades$algebra <- 1.0
Expand Down

0 comments on commit 98b12f0

Please sign in to comment.