Skip to content

Commit

Permalink
test: ignore some lines for coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Nov 20, 2023
1 parent bdc26c5 commit d825df2
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export class SafeDsCallGraphComputer {

private getExecutedCalls(syntheticCall: SyntheticCall): SyntheticCall[] {
if (!syntheticCall.callable) {
/* c8 ignore next 2 */
return [];
}

Expand All @@ -136,6 +137,7 @@ export class SafeDsCallGraphComputer {
} else if (isSdsClass(callable) || isSdsEnumVariant(callable) || isSdsFunction(callable)) {
return this.getExecutedCallsInStubCallable(callable, substitutions);
} else {
/* c8 ignore next 2 */
return [];
}
}
Expand Down Expand Up @@ -234,6 +236,7 @@ export class SafeDsCallGraphComputer {
if (substitution instanceof EvaluatedCallable) {
return substitution;
} else {
/* c8 ignore next 2 */
return undefined;
}
}
Expand All @@ -250,6 +253,7 @@ export class SafeDsCallGraphComputer {
} else if (isSdsExpressionLambda(callableOrParameter)) {
return new ExpressionLambdaClosure(callableOrParameter, substitutions);
} else {
/* c8 ignore next 2 */
return undefined;
}
}
Expand Down Expand Up @@ -288,13 +292,15 @@ export class SafeDsCallGraphComputer {
// Ignore arguments that don't get assigned to a parameter
const parameterIndex = this.nodeMapper.argumentToParameter(it)?.$containerIndex ?? -1;
if (parameterIndex === -1) {
/* c8 ignore next 2 */
return [];
}

// argumentToParameter returns parameters of callable types. We have to remap this to parameter of the
// actual callable.
const parameter = parameters[parameterIndex];
if (!parameter) {
/* c8 ignore next 2 */
return [];
}

Expand All @@ -316,6 +322,7 @@ export class SafeDsCallGraphComputer {
*/
getCalls(node: AstNode | undefined): SdsCall[] {
if (!node) {
/* c8 ignore next 2 */
return [];
}

Expand All @@ -338,6 +345,7 @@ class SyntheticCall {

equals(other: SyntheticCall): boolean {
if (!this.callable) {
/* c8 ignore next 2 */
return !other.callable && substitutionsAreEqual(this.substitutions, other.substitutions);
}

Expand Down

0 comments on commit d825df2

Please sign in to comment.