[policy-gen] Fix the code to actually use the correct capture group
ClosedPublic

Authored by ahmadsamir on Feb 10 2020, 2:36 PM.

Details

Summary

This was a mistake in porting form QRegExp::capturedTexts() to QRegularExpression;
capturedTexts(1) translates to QRegularExpressionMatch::captured(1), not 0.

Thanks to brouilk for reporting it in https://phabricator.kde.org/D26118.

Add examples of the text we're matching against.

Add unit test that executes kauth-policy-gen on a .actions ini-formatted
file (based on .actions file from the plymouth-kcm repo) and compare the
output to a reference .policy file.

Test Plan

make && ctest

Diff Detail

Repository
R283 KAuth
Branch
l-policy-gen (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 22352
Build 22370: arc lint + arc unit
ahmadsamir created this revision.Feb 10 2020, 2:36 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptFeb 10 2020, 2:36 PM
ahmadsamir requested review of this revision.Feb 10 2020, 2:36 PM
ahmadsamir edited the test plan for this revision. (Show Details)Feb 10 2020, 6:07 PM
ahmadsamir added a reviewer: apol.
ahmadsamir edited the summary of this revision. (Show Details)
ahmadsamir edited the test plan for this revision. (Show Details)

Add a simple/crude unit test

Follow naming convention, KAuth

ahmadsamir retitled this revision from [policy-gen] Fix the code to actually captured the correct capture group to [policy-gen] Fix the code to actually use the correct capture group.

Fix commit message

davidedmundson accepted this revision.Feb 11 2020, 1:59 PM
This revision is now accepted and ready to land.Feb 11 2020, 1:59 PM
This revision was automatically updated to reflect the committed changes.