All files / src/objects program.ts

88.89% Statements 40/45
90% Branches 9/10
85.71% Functions 6/7
88.89% Lines 40/45

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 461x 1x 1x 4733x 4733x 4733x 4733x 9439x 9439x 4733x 4733x 2022x 2022x     2022x 2022x 4733x 4733x       4733x 4733x 104x 104x 104x 104x 104x 4733x 4733x 5288x 5288x 5288x 4733x 4733x 1593x 1052x 1052x 1052x 1593x 1593x 1593x 4733x 4733x  
import {ABAPObject} from "./_abap_object";
import {ABAPFile} from "../abap/abap_file";
 
export class Program extends ABAPObject {
  private isIncludeValue: boolean | undefined = undefined;
 
  public getType(): string {
    return "PROG";
  }
 
  public getSequencedFiles(): readonly ABAPFile[] {
    const main = this.getMainABAPFile();
    if (main === undefined) {
      return [];
    }
    return [main];
  }
 
  public getDescription(): string | undefined {
    // todo
    return undefined;
  }
 
  public getAllowedNaming() {
    return {
      maxLength: 40,
      allowNamespace: true,
    };
  }
 
  public setDirty(): void {
    this.isIncludeValue = undefined;
    super.setDirty();
  }
 
  public isInclude(): boolean {
    if (this.isIncludeValue === undefined) {
      const file = this.getXMLFile();
      this.isIncludeValue = file ? file.getRaw().includes("<SUBC>I</SUBC>") : false;
    }
 
    return this.isIncludeValue;
  }
 
}