Diffusion KAuth f6020e857424

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

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

Description

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

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

Reviewers: Frameworks, dfaure, apol, davidedmundson

Reviewed By: davidedmundson

Subscribers: kde-frameworks-devel

Tags: Frameworks

Differential Revision: https://phabricator.kde.org/D27288

Details

Committed
ahmadsamirFeb 11 2020, 3:13 PM
Reviewer
davidedmundson
Differential Revision
D27288: [policy-gen] Fix the code to actually use the correct capture group
Parents
R283:4d241b3f4f54: Drop Policykit backend
Branches
Unknown
Tags
Unknown