All files / src/objects program.ts

88.88% Statements 40/45
90% Branches 9/10
85.71% Functions 6/7
88.88% 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 5670x 5670x 5670x 5670x 22203x 22203x 5670x 5670x 2732x 2732x     2732x 2732x 5670x 5670x       5670x 5670x 148x 148x 148x 148x 148x 5670x 5670x 6479x 6479x 6479x 5670x 5670x 2700x 1807x 1807x 1807x 2700x 2700x 2700x 5670x 5670x  
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;
  }
 
}