Skip to content

Bug: Ability regex does not overmatch test is silently ignored #1107

Description

@Bing-su

Description

The Ability regex does not overmatch unit test in test/unittests/regex_test.ts is silently ignored

Additional Details / Steps to Reproduce

You can reproduce the issue by running the test with an intentional failure.

  logDefsToTest.forEach((type) => {
    it(type, () => {
      const baseFunc = (params?: RegexUtilParams) => buildRegex(type, params);
      const Helper = new RegexTestUtil(type, examples[type], baseFunc, true);
      Helper.run();

      if (type === 'Ability')
        it('Ability regex does not overmatch', () => {
          // Tests a bug where a :1E: later in the line would be caught by overzealous
          // matchers on source names.
          // TODO: Preserved for historical reasons - maybe remove?
          const testLine =
            '[20:29:39.392] ActionEffect 15:107B9AC8:Tako Yaki:07:Attack:40017D58:Daxio:710003:DC0000:1E:50000:1C:1B60000:550003:2CA000:0:0:0:0:0:0:0:0:8207:24837:7230:7230:0:1000:527.5806:-362.7833:-19.61513:2.898741:8998:8998:10000:10000:0:1000:528.6487:-365.8656:-22.08109:-0.3377206:000AD7BF:0:1';
          Helper.captureTest((params?: RegexUtilParams) => Regexes.ability(params), [testLine]);
          const abilityHallowed = Regexes.ability({ id: '1E' });
          assert.isNull(testLine.match(abilityHallowed));
          assert.ok(false);  //
        });
    });
  });

Additionally, while modifying the test to run, I noticed that the following test failed.

          Helper.captureTest((params?: RegexUtilParams) => Regexes.ability(params), [testLine]);

Cactbot Module

Dev Tools / Internals

Configuration Info

commit: 11da0d0

Log & Screenshots

No response

Confirmation

  • I reviewed Common Issues and Workarounds and verified that my settings are correct.
  • I used the search function to confirm this issue doesn't already exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfix-meBug report validated or feature request planned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions