mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Remove minus since it's an invalid literal
This commit is contained in:
parent
e803076063
commit
6d046f251e
@ -616,7 +616,7 @@ bool AutoType::checkSyntax(const QString& string)
|
|||||||
// the ":" allows custom commands with syntax S:Field
|
// the ":" allows custom commands with syntax S:Field
|
||||||
// exclude BEEP otherwise will be checked as valid
|
// exclude BEEP otherwise will be checked as valid
|
||||||
QString normalCommands = "(?!BEEP\\s)[A-Z:]*" + allowRepetition;
|
QString normalCommands = "(?!BEEP\\s)[A-Z:]*" + allowRepetition;
|
||||||
QString specialLiterals = "[\\^\\%\\(\\)~\\{\\}\\[\\]\\+-]" + allowRepetition;
|
QString specialLiterals = "[\\^\\%\\(\\)~\\{\\}\\[\\]\\+]" + allowRepetition;
|
||||||
QString functionKeys = "(?:F[1-9]" + allowRepetition + "|F1[0-2])" + allowRepetition;
|
QString functionKeys = "(?:F[1-9]" + allowRepetition + "|F1[0-2])" + allowRepetition;
|
||||||
QString numpad = "NUMPAD\\d" + allowRepetition;
|
QString numpad = "NUMPAD\\d" + allowRepetition;
|
||||||
QString delay = "DELAY=\\d+";
|
QString delay = "DELAY=\\d+";
|
||||||
|
@ -31,7 +31,6 @@
|
|||||||
#include <QTemporaryFile>
|
#include <QTemporaryFile>
|
||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QEvent>
|
#include <QEvent>
|
||||||
#include <iostream>
|
|
||||||
|
|
||||||
#include "autotype/AutoType.h"
|
#include "autotype/AutoType.h"
|
||||||
#include "core/Config.h"
|
#include "core/Config.h"
|
||||||
|
@ -286,7 +286,7 @@ void TestAutoType::testGlobalAutoTypeRegExp()
|
|||||||
void TestAutoType::testAutoTypeSyntaxChecks()
|
void TestAutoType::testAutoTypeSyntaxChecks()
|
||||||
{
|
{
|
||||||
// Huge sequence
|
// Huge sequence
|
||||||
QCOMPARE(true, AutoType::checkSyntax("{word 23}{F1 23}{~ 23}{% 23}{^}{F12}{(}{) 23}{[}{[}{]}{Delay=23}{+}{-}~+%@fixedstring"));
|
QCOMPARE(true, AutoType::checkSyntax("{word 23}{F1 23}{~ 23}{% 23}{^}{F12}{(}{) 23}{[}{[}{]}{Delay=23}{+}{SUBTRACT}~+%@fixedstring"));
|
||||||
|
|
||||||
QCOMPARE(true, AutoType::checkSyntax("{NUMPAD1 3}"));
|
QCOMPARE(true, AutoType::checkSyntax("{NUMPAD1 3}"));
|
||||||
|
|
||||||
@ -298,6 +298,10 @@ void TestAutoType::testAutoTypeSyntaxChecks()
|
|||||||
QCOMPARE(true, AutoType::checkSyntax("{VKEY-EX 0x01}"));
|
QCOMPARE(true, AutoType::checkSyntax("{VKEY-EX 0x01}"));
|
||||||
// Bad sequence
|
// Bad sequence
|
||||||
QCOMPARE(false, AutoType::checkSyntax("{{{}}{}{}}{{}}"));
|
QCOMPARE(false, AutoType::checkSyntax("{{{}}{}{}}{{}}"));
|
||||||
|
// Good sequence
|
||||||
|
QCOMPARE(true, AutoType::checkSyntax("{{}{}}{}}{{}"));
|
||||||
|
QCOMPARE(true, AutoType::checkSyntax("{]}{[}{[}{]}"));
|
||||||
|
QCOMPARE(true, AutoType::checkSyntax("{)}{(}{(}{)}"));
|
||||||
// High DelAY / low delay
|
// High DelAY / low delay
|
||||||
QCOMPARE(true, AutoType::checkHighDelay("{DelAY 50000}"));
|
QCOMPARE(true, AutoType::checkHighDelay("{DelAY 50000}"));
|
||||||
QCOMPARE(false, AutoType::checkHighDelay("{delay 50}"));
|
QCOMPARE(false, AutoType::checkHighDelay("{delay 50}"));
|
||||||
|
Loading…
Reference in New Issue
Block a user