---
policy: /ce/unit-test/list-from/text-items
logic: /ce/unit-test/list-from/text-items/unit-test.logic.yaml
executionTime: 2025-07-08T23:29:08.395273755Z
rows:
  - id: From-Null
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 199
      actual: 199
    conditionText:
      expected: "unitTest(From-Null): null.asListOfText(',') == listOfText([])"
      actual: "unitTest(From-Null): null.asListOfText(',') == listOfText([])"
    runtimeError: {}
  - id: From-Empty
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 299
      actual: 299
    conditionText:
      expected: "unitTest(From-Empty): ''.asListOfText(',') == listOfText([''])"
      actual: "unitTest(From-Empty): ''.asListOfText(',') == listOfText([''])"
    runtimeError: {}
  - id: From-Whitespace
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 399
      actual: 399
    conditionText:
      expected: "unitTest(From-Whitespace): ' '.asListOfText(',') == listOfText([''])"
      actual: "unitTest(From-Whitespace): ' '.asListOfText(',') == listOfText([''])"
    runtimeError: {}
  - id: Single
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 499
      actual: 499
    conditionText:
      expected: "unitTest(Single): 'a'.asListOfText(',') == listOfText(['a'])"
      actual: "unitTest(Single): 'a'.asListOfText(',') == listOfText(['a'])"
    runtimeError: {}
  - id: Single-Case
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 599
      actual: 599
    conditionText:
      expected: "unitTest(Single-Case): 'A'.asListOfText(',') == listOfText(['a'])"
      actual: "unitTest(Single-Case): 'A'.asListOfText(',') == listOfText(['a'])"
    runtimeError: {}
  - id: Single-Whitespaces
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 699
      actual: 699
    conditionText:
      expected: "unitTest(Single-Whitespaces): ' a '.asListOfText(',') == listOfText(['a'])"
      actual: "unitTest(Single-Whitespaces): ' a '.asListOfText(',') == listOfText(['a'])"
    runtimeError: {}
  - id: Empty-Values
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 799
      actual: 799
    conditionText:
      expected: "unitTest(Empty-Values): ','.asListOfText(',') == listOfText(['',\
        \ ''])"
      actual: "unitTest(Empty-Values): ','.asListOfText(',') == listOfText(['', ''])"
    runtimeError: {}
  - id: Duplicate
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 899
      actual: 899
    conditionText:
      expected: "unitTest(Duplicate): 'a,a'.asListOfText(',') != listOfText(['a'])"
      actual: "unitTest(Duplicate): 'a,a'.asListOfText(',') != listOfText(['a'])"
    runtimeError: {}
  - id: Order
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 999
      actual: 999
    conditionText:
      expected: "unitTest(Order): 'a,b'.asListOfText(',') != listOfText(['b', 'a'])"
      actual: "unitTest(Order): 'a,b'.asListOfText(',') != listOfText(['b', 'a'])"
    runtimeError: {}
  - id: Separator-NewLine
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1099
      actual: 1099
    conditionText:
      expected: "unitTest(Separator-NewLine): 'line1\\nline2\\nline3\\n'.asListOfText('\\\
        n') == listOfText(['line1', 'line2', 'line3', ''])"
      actual: "unitTest(Separator-NewLine): 'line1\\nline2\\nline3\\n'.asListOfText('\\\
        n') == listOfText(['line1', 'line2', 'line3', ''])"
    runtimeError: {}
  - id: Separator-Word
    match: true
    status:
      expected: COMPLIANT
      actual: COMPLIANT
    conditionIndex:
      expected: 1199
      actual: 1199
    conditionText:
      expected: "unitTest(Separator-Word): 'banana'.asListOfText('an') == listOfText(['b',\
        \ '', 'a'])"
      actual: "unitTest(Separator-Word): 'banana'.asListOfText('an') == listOfText(['b',\
        \ '', 'a'])"
    runtimeError: {}
usedFiles:
  - path: /ce/unit-test/list-from/text-items/policy.yaml
    md5Hash: BA9AF9E9B0587579B9E103A5BA2A6522
    content: |
      ---
      names:
        full: LIST_FROM Unit Tests for Text Items
        contextual: Text Items
      description: ""
  - path: /ce/unit-test/list-from/text-items/unit-test.logic.yaml
    md5Hash: 991DDF4C94FC71B18682341C8DDF570A
    content: |-
      ---
      inputType: CA10__CaAwsInstance__c
      conditions:
        - status: COMPLIANT
          currentStateMessage: From-Null
          check:
            UNIT_TEST:
              id: From-Null
              expected:
                text: "unitTest(From-Null): null.asListOfText(',') == listOfText([])"
              arg:
                IS_EQUAL:
                  left:
                    LIST_FROM:
                      separator: ","
                      arg:
                        UNIT_TEST_NULL:
                          returnType: TEXT
                  right:
                    LIST:
                      itemType: TEXT
                      items: []
        - status: COMPLIANT
          currentStateMessage: From-Empty
          check:
            UNIT_TEST:
              id: From-Empty
              expected:
                text: "unitTest(From-Empty): ''.asListOfText(',') == listOfText([''])"
              arg:
                IS_EQUAL:
                  left:
                    LIST_FROM:
                      separator: ","
                      arg:
                         TEXT: ""
                  right:
                    LIST:
                      itemType: TEXT
                      items:
                        - ""
        - status: COMPLIANT
          currentStateMessage: From-Whitespace
          check:
            UNIT_TEST:
              id: From-Whitespace
              expected:
                text: "unitTest(From-Whitespace): ' '.asListOfText(',') == listOfText([''])"
              arg:
                IS_EQUAL:
                  left:
                    LIST_FROM:
                      separator: ","
                      arg:
                        TEXT: " "
                  right:
                    LIST:
                      itemType: TEXT
                      items:
                        - ""
        - status: COMPLIANT
          currentStateMessage: Single
          check:
            UNIT_TEST:
              id: Single
              expected:
                text: "unitTest(Single): 'a'.asListOfText(',') == listOfText(['a'])"
              arg:
                IS_EQUAL:
                  left:
                    LIST_FROM:
                      separator: ","
                      arg:
                        TEXT: "a"
                  right:
                    LIST:
                      itemType: TEXT
                      items:
                        - "a"
        - status: COMPLIANT
          currentStateMessage: Single-Case
          check:
            UNIT_TEST:
              id: Single-Case
              expected:
                text: "unitTest(Single-Case): 'A'.asListOfText(',') == listOfText(['a'])"
              arg:
                IS_EQUAL:
                  left:
                    LIST_FROM:
                      separator: ","
                      arg:
                        TEXT: "A"
                  right:
                    LIST:
                      itemType: TEXT
                      items:
                        - "a"
        - status: COMPLIANT
          currentStateMessage: Single-Whitespaces
          check:
            UNIT_TEST:
              id: Single-Whitespaces
              expected:
                text: "unitTest(Single-Whitespaces): ' a '.asListOfText(',') == listOfText(['a'])"
              arg:
                IS_EQUAL:
                  left:
                    LIST_FROM:
                      separator: ","
                      arg:
                        TEXT: " a "
                  right:
                    LIST:
                      itemType: TEXT
                      items:
                        - "a"
        - status: COMPLIANT
          currentStateMessage: Empty-Values
          check:
            UNIT_TEST:
              id: Empty-Values
              expected:
                text: "unitTest(Empty-Values): ','.asListOfText(',') == listOfText(['', ''])"
              arg:
                IS_EQUAL:
                  left:
                    LIST_FROM:
                      separator: ","
                      arg:
                        TEXT: ","
                  right:
                    LIST:
                      itemType: TEXT
                      items:
                        - ""
                        - ""
        - status: COMPLIANT
          currentStateMessage: Duplicate
          check:
            UNIT_TEST:
              id: Duplicate
              expected:
                text: "unitTest(Duplicate): 'a,a'.asListOfText(',') != listOfText(['a'])"
              arg:
                NOT_EQUAL:
                  left:
                    LIST_FROM:
                      separator: ","
                      arg:
                        TEXT: "a,a"
                  right:
                    LIST:
                      itemType: TEXT
                      items:
                        - "a"
        - status: COMPLIANT
          currentStateMessage: Order
          check:
            UNIT_TEST:
              id: Order
              expected:
                text: "unitTest(Order): 'a,b'.asListOfText(',') != listOfText(['b', 'a'])"
              arg:
                NOT_EQUAL:
                  left:
                    LIST_FROM:
                      separator: ","
                      arg:
                        TEXT: "a,b"
                  right:
                    LIST:
                      itemType: TEXT
                      items:
                        - "b"
                        - "a"
        - status: COMPLIANT
          currentStateMessage: Separator-NewLine
          check:
            UNIT_TEST:
              id: Separator-NewLine
              expected:
                text: "unitTest(Separator-NewLine): 'line1\\nline2\\nline3\\n'.asListOfText('\\n') == listOfText(['line1', 'line2', 'line3', ''])"
              arg:
                IS_EQUAL:
                  left:
                    LIST_FROM:
                      separator: "\n"
                      arg:
                        TEXT: "line1\nline2\nline3\n"
                  right:
                    LIST:
                      itemType: TEXT
                      items:
                        - "line1"
                        - "line2"
                        - "line3"
                        - ""
        - status: COMPLIANT
          currentStateMessage: Separator-Word
          check:
            UNIT_TEST:
              id: Separator-Word
              expected:
                text: "unitTest(Separator-Word): 'banana'.asListOfText('an') == listOfText(['b', '', 'a'])"
              arg:
                IS_EQUAL:
                  left:
                    LIST_FROM:
                      separator: "an"
                      arg:
                        TEXT: "banana"
                  right:
                    LIST:
                      itemType: TEXT
                      items:
                        - "b"
                        - ""
                        - "a"
      otherwise:
        status: INCOMPLIANT
        currentStateMessage: Test Failed
        remediationMessage: Developer Fix Required
script: |-
  CREATE TEMP FUNCTION mock_ExpectedResult()
  RETURNS ARRAY<STRUCT<
          Id STRING,
          expectedResult STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, runtimeError STRING>
      >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "Id" : "From-Null",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 199,
      "conditionText" : "unitTest(From-Null): null.asListOfText(',') == listOfText([])",
      "runtimeError" : null
    }
  }, {
    "Id" : "From-Empty",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 299,
      "conditionText" : "unitTest(From-Empty): ''.asListOfText(',') == listOfText([''])",
      "runtimeError" : null
    }
  }, {
    "Id" : "From-Whitespace",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 399,
      "conditionText" : "unitTest(From-Whitespace): ' '.asListOfText(',') == listOfText([''])",
      "runtimeError" : null
    }
  }, {
    "Id" : "Single",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 499,
      "conditionText" : "unitTest(Single): 'a'.asListOfText(',') == listOfText(['a'])",
      "runtimeError" : null
    }
  }, {
    "Id" : "Single-Case",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 599,
      "conditionText" : "unitTest(Single-Case): 'A'.asListOfText(',') == listOfText(['a'])",
      "runtimeError" : null
    }
  }, {
    "Id" : "Single-Whitespaces",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 699,
      "conditionText" : "unitTest(Single-Whitespaces): ' a '.asListOfText(',') == listOfText(['a'])",
      "runtimeError" : null
    }
  }, {
    "Id" : "Empty-Values",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 799,
      "conditionText" : "unitTest(Empty-Values): ','.asListOfText(',') == listOfText(['', ''])",
      "runtimeError" : null
    }
  }, {
    "Id" : "Duplicate",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 899,
      "conditionText" : "unitTest(Duplicate): 'a,a'.asListOfText(',') != listOfText(['a'])",
      "runtimeError" : null
    }
  }, {
    "Id" : "Order",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 999,
      "conditionText" : "unitTest(Order): 'a,b'.asListOfText(',') != listOfText(['b', 'a'])",
      "runtimeError" : null
    }
  }, {
    "Id" : "Separator-NewLine",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1099,
      "conditionText" : "unitTest(Separator-NewLine): 'line1\\nline2\\nline3\\n'.asListOfText('\\n') == listOfText(['line1', 'line2', 'line3', ''])",
      "runtimeError" : null
    }
  }, {
    "Id" : "Separator-Word",
    "expectedResult" : {
      "status" : "COMPLIANT",
      "conditionIndex" : 1199,
      "conditionText" : "unitTest(Separator-Word): 'banana'.asListOfText('an') == listOfText(['b', '', 'a'])",
      "runtimeError" : null
    }
  } ];
  """;

  CREATE TEMP FUNCTION mock_CA10__CaAwsInstance__c()
  RETURNS ARRAY<STRUCT<
      Id STRING,
      CA10__disappearanceTime__c TIMESTAMP,
      context STRUCT<
          snapshotTime TIMESTAMP
      >
  >>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
    return [ {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "From-Null"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "From-Empty"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "From-Whitespace"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Single"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Single-Case"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Single-Whitespaces"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Empty-Values"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Duplicate"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Order"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Separator-NewLine"
  }, {
    "context" : {
      "snapshotTime" : new Date("2024-01-01T00:00:00.000Z")
    },
    "Id" : "Separator-Word"
  } ];
  """;

  CREATE TEMP FUNCTION process_CA10__CaAwsInstance__c(
      obj STRUCT<
          Id STRING,
          CA10__disappearanceTime__c TIMESTAMP
      >,
      snapshotTime TIMESTAMP
  )
  RETURNS STRUCT<status STRING, conditionIndex DECIMAL, conditionText STRING, currentStateMessage STRING, currentStateReferences STRING, remediation STRING, runtimeError STRING>
  DETERMINISTIC
  LANGUAGE js
  AS r"""
      var CollectionLib = new function () {
          this.parse = function(arg, separator, skipEmpty, skipDuplicates, sort, normalize) {
              if (arg == null) return [];
              let parts = arg.split(separator);
              return this.fromArray(parts, skipEmpty, skipDuplicates, sort, normalize);
          };
          this.fromArray = function(arr, skipEmpty, skipDuplicates, sort, normalize) {
              if (arr == null) return [];
              let result = [];
              let seen = new Set();
              arr.forEach(el => {
                  let normalized = normalize ? TextLib.normalize(el) : BytesLib.normalize(el);
                  if (!skipEmpty || (normalize ? TextLib.isNotEmpty(el) : BytesLib.isNotEmpty(el))) {
                      if (!skipDuplicates || !seen.has(normalized)) {
                          if (skipDuplicates) seen.add(normalized);
                          result.push(normalized);
                      }
                  }
              });
              if (sort) result.sort();
              return result;
          };
          this.equal = function(left, right) {
              left = left == null ? [] : left;
              right = right == null ? [] : right;
              if (left.length !== right.length) return false;
              for (let i = 0; i < left.length; i++) {
                  if (left[i] !== right[i]) return false;
              }
              return true;
          };
          this.notEqual = function(left, right) {
              return !this.equal(left, right);
          };
          this.size = function(collection) {
              return collection == null ? 0 : collection.length;
          };
          this.startsWith = function(collection, search, normalize) {
              if (collection == null || collection.length === 0) return false;
              let normalizedSearch = normalize ? TextLib.normalize(search) : BytesLib.normalize(search);
              return collection[0] === normalizedSearch;
          };
          this.endsWith = function(collection, search, normalize) {
              if (collection == null || collection.length === 0) return false;
              let normalizedSearch = normalize ? TextLib.normalize(search) : BytesLib.normalize(search);
              return collection[collection.length - 1] === normalizedSearch;
          };
          this.contains = function(collection, search, normalize) {
              if (collection == null || collection.length === 0) return false;
              return collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search));
          };
          this.containsAll = function(collection, searchArray, normalize) {
              if (collection == null || collection.length === 0 || searchArray == null || searchArray.length === 0) return false;
              return searchArray.every(search => collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search)));
          };
          this.containsAny = function(collection, searchArray, normalize) {
              if (collection == null || collection.length === 0 || searchArray == null || searchArray.length === 0) return false;
              return searchArray.some(search => collection.includes(normalize ? TextLib.normalize(search) : BytesLib.normalize(search)));
          };
      }();
      var TextLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg.replace(/\s+/g, ' ').trim().toLowerCase();
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
          this.containsAll = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
          };
          this.containsAny = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
          };
      }();
      var BytesLib = new function () {
          this.normalize = function(arg) {
              return arg == null ? '' : arg;
          };
          this.isEmpty = function(arg) {
              return this.normalize(arg) == '';
          };
          this.isNotEmpty = function(arg) {
              return this.normalize(arg) != '';
          };
          this.equal = function(left, right) {
              return this.normalize(left) == this.normalize(right);
          };
          this.notEqual = function(left, right) {
              return this.normalize(left) != this.normalize(right);
          };
          this.startsWith = function(arg, substring) {
              return this.normalize(arg).startsWith(this.normalize(substring));
          };
          this.endsWith = function(arg, substring) {
              return this.normalize(arg).endsWith(this.normalize(substring));
          };
          this.contains = function(arg, substring) {
              return this.normalize(arg).includes(this.normalize(substring));
          };
          this.containsAll = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.every(sub => normalizedArg.includes(this.normalize(sub)));
          };
          this.containsAny = function(arg, substrings) {
              if (substrings == null || substrings.length === 0) return false;
              let normalizedArg = this.normalize(arg);
              return substrings.some(sub => normalizedArg.includes(this.normalize(sub)));
          };
      }();
      var references1 = [];
      // condition[0], conditionIndex:[0..99]
      references1.push('Deleted From AWS [CA10__disappearanceTime__c]: ' + obj.CA10__disappearanceTime__c);
      if (obj.CA10__disappearanceTime__c != null) {
          return {status: 'DISAPPEARED', conditionIndex: 99, conditionText: "isDisappeared(CA10__disappearanceTime__c)", currentStateMessage: "Object is deleted in the source", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[1], conditionIndex:[100..199]
      if (obj.Id == 'From-Null' && CollectionLib.equal(CollectionLib.parse(null, ',', false, false, false, true), CollectionLib.fromArray([], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 199, conditionText: "unitTest(From-Null): null.asListOfText(',') == listOfText([])", currentStateMessage: "From-Null", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[2], conditionIndex:[200..299]
      if (obj.Id == 'From-Empty' && CollectionLib.equal(CollectionLib.parse('', ',', false, false, false, true), CollectionLib.fromArray([''], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 299, conditionText: "unitTest(From-Empty): ''.asListOfText(',') == listOfText([''])", currentStateMessage: "From-Empty", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[3], conditionIndex:[300..399]
      if (obj.Id == 'From-Whitespace' && CollectionLib.equal(CollectionLib.parse(' ', ',', false, false, false, true), CollectionLib.fromArray([''], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 399, conditionText: "unitTest(From-Whitespace): ' '.asListOfText(',') == listOfText([''])", currentStateMessage: "From-Whitespace", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[4], conditionIndex:[400..499]
      if (obj.Id == 'Single' && CollectionLib.equal(CollectionLib.parse('a', ',', false, false, false, true), CollectionLib.fromArray(['a'], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 499, conditionText: "unitTest(Single): 'a'.asListOfText(',') == listOfText(['a'])", currentStateMessage: "Single", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[5], conditionIndex:[500..599]
      if (obj.Id == 'Single-Case' && CollectionLib.equal(CollectionLib.parse('A', ',', false, false, false, true), CollectionLib.fromArray(['a'], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 599, conditionText: "unitTest(Single-Case): 'A'.asListOfText(',') == listOfText(['a'])", currentStateMessage: "Single-Case", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[6], conditionIndex:[600..699]
      if (obj.Id == 'Single-Whitespaces' && CollectionLib.equal(CollectionLib.parse(' a ', ',', false, false, false, true), CollectionLib.fromArray(['a'], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 699, conditionText: "unitTest(Single-Whitespaces): ' a '.asListOfText(',') == listOfText(['a'])", currentStateMessage: "Single-Whitespaces", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[7], conditionIndex:[700..799]
      if (obj.Id == 'Empty-Values' && CollectionLib.equal(CollectionLib.parse(',', ',', false, false, false, true), CollectionLib.fromArray(['', ''], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 799, conditionText: "unitTest(Empty-Values): ','.asListOfText(',') == listOfText(['', ''])", currentStateMessage: "Empty-Values", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[8], conditionIndex:[800..899]
      if (obj.Id == 'Duplicate' && CollectionLib.notEqual(CollectionLib.parse('a,a', ',', false, false, false, true), CollectionLib.fromArray(['a'], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 899, conditionText: "unitTest(Duplicate): 'a,a'.asListOfText(',') != listOfText(['a'])", currentStateMessage: "Duplicate", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[9], conditionIndex:[900..999]
      if (obj.Id == 'Order' && CollectionLib.notEqual(CollectionLib.parse('a,b', ',', false, false, false, true), CollectionLib.fromArray(['b', 'a'], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 999, conditionText: "unitTest(Order): 'a,b'.asListOfText(',') != listOfText(['b', 'a'])", currentStateMessage: "Order", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[10], conditionIndex:[1000..1099]
      if (obj.Id == 'Separator-NewLine' && CollectionLib.equal(CollectionLib.parse('line1\nline2\nline3\n', '\n', false, false, false, true), CollectionLib.fromArray(['line1', 'line2', 'line3', ''], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 1099, conditionText: "unitTest(Separator-NewLine): 'line1\\nline2\\nline3\\n'.asListOfText('\\n') == listOfText(['line1', 'line2', 'line3', ''])", currentStateMessage: "Separator-NewLine", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      // condition[11], conditionIndex:[1100..1199]
      if (obj.Id == 'Separator-Word' && CollectionLib.equal(CollectionLib.parse('banana', 'an', false, false, false, true), CollectionLib.fromArray(['b', '', 'a'], false, false, false, true))) {
          return {status: 'COMPLIANT', conditionIndex: 1199, conditionText: "unitTest(Separator-Word): 'banana'.asListOfText('an') == listOfText(['b', '', 'a'])", currentStateMessage: "Separator-Word", currentStateReferences: references1.join('\n'), remediation: null, runtimeError: null};
      }
      return {status: 'INCOMPLIANT', conditionIndex: 1200, conditionText: "otherwise", currentStateMessage: "Test Failed", currentStateReferences: references1.join('\n'), remediation: "Developer Fix Required", runtimeError: null};
  """;


  SELECT
    expectedResult.Id as Id,
    IF (
      IFNULL(expectedResult.expectedResult.status, '') = IFNULL(sObject.result.status, '')
      AND IFNULL(expectedResult.expectedResult.conditionIndex, -1) = IFNULL(sObject.result.conditionIndex, -1)
      AND IFNULL(expectedResult.expectedResult.conditionText, '') = IFNULL(sObject.result.conditionText, '')
      AND IFNULL(expectedResult.expectedResult.runtimeError, '') = IFNULL(sObject.result.runtimeError, ''),
      "MATCH",
      "FAIL"
    ) as match,
    expectedResult.expectedResult.status as expectedStatus, sObject.result.status as actualStatus,
    expectedResult.expectedResult.conditionIndex as expectedConditionIndex, sObject.result.conditionIndex as actualConditionIndex,
    expectedResult.expectedResult.conditionText as expectedConditionText, sObject.result.conditionText as actualConditionText,
    expectedResult.expectedResult.runtimeError as expectedRuntimeError, sObject.result.runtimeError as actualRuntimeError
  FROM UNNEST(mock_ExpectedResult()) expectedResult
  LEFT JOIN (
      SELECT
          sObject.Id AS Id,
          sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c,
          process_CA10__CaAwsInstance__c(
              STRUCT(
                  sObject.Id AS Id,
                  sObject.CA10__disappearanceTime__c AS CA10__disappearanceTime__c
              ),
              sObject.context.snapshotTime
          ) as result
      FROM UNNEST(mock_CA10__CaAwsInstance__c()) AS sObject
  ) sObject ON sObject.Id = expectedResult.Id;
