@@ -3805,7 +3805,7 @@ void TestQgsProcessing::parameterString()
3805
3805
QCOMPARE ( def->valueAsPythonString ( QStringLiteral ( " abc" ), context ), QStringLiteral ( " 'abc'" ) );
3806
3806
QCOMPARE ( def->valueAsPythonString ( QStringLiteral ( " abc\n def" ), context ), QStringLiteral ( " 'abc\\ ndef'" ) );
3807
3807
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProperty::fromExpression ( " \" a\" =1" ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" a\" =1')" ) );
3808
- QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\' complex\' username=\" complex\" '" ) );
3808
+ QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\\ 'complex\\ ' username=\\\ " complex\\ \" '" ) );
3809
3809
3810
3810
QString code = def->asScriptCode ();
3811
3811
QCOMPARE ( code, QStringLiteral ( " ##non_optional=string" ) );
@@ -4368,7 +4368,7 @@ void TestQgsProcessing::parameterFeatureSource()
4368
4368
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProcessingFeatureSourceDefinition ( QgsProperty::fromExpression ( " \" abc\" || \" def\" " ) ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" abc\" || \" def\" ')" ) );
4369
4369
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProperty::fromExpression ( " \" a\" =1" ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" a\" =1')" ) );
4370
4370
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( v2 ), context ), QStringLiteral ( " '%1'" ).arg ( vector2 ) );
4371
- QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\' complex\' username=\" complex\" '" ) );
4371
+ QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\\ 'complex\\ ' username=\\\ " complex\\ \" '" ) );
4372
4372
4373
4373
QVariantMap map = def->toVariantMap ();
4374
4374
QgsProcessingParameterFeatureSource fromMap ( " x" );
@@ -4480,7 +4480,7 @@ void TestQgsProcessing::parameterFeatureSink()
4480
4480
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProcessingOutputLayerDefinition ( QgsProperty::fromValue ( " abc" ) ) ), context ), QStringLiteral ( " 'abc'" ) );
4481
4481
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProcessingOutputLayerDefinition ( QgsProperty::fromExpression ( " \" abc\" || \" def\" " ) ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" abc\" || \" def\" ')" ) );
4482
4482
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProperty::fromExpression ( " \" a\" =1" ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" a\" =1')" ) );
4483
- QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\' complex\' username=\" complex\" '" ) );
4483
+ QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\\ 'complex\\ ' username=\\\ " complex\\ \" '" ) );
4484
4484
4485
4485
QCOMPARE ( def->defaultFileExtension (), QStringLiteral ( " shp" ) );
4486
4486
QCOMPARE ( def->generateTemporaryDestination (), QStringLiteral ( " memory:" ) );
@@ -4608,7 +4608,7 @@ void TestQgsProcessing::parameterVectorOut()
4608
4608
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProcessingOutputLayerDefinition ( QgsProperty::fromValue ( " abc" ) ) ), context ), QStringLiteral ( " 'abc'" ) );
4609
4609
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProcessingOutputLayerDefinition ( QgsProperty::fromExpression ( " \" abc\" || \" def\" " ) ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" abc\" || \" def\" ')" ) );
4610
4610
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProperty::fromExpression ( " \" a\" =1" ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" a\" =1')" ) );
4611
- QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\' complex\' username=\" complex\" '" ) );
4611
+ QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\\ 'complex\\ ' username=\\\ " complex\\ \" '" ) );
4612
4612
4613
4613
QCOMPARE ( def->defaultFileExtension (), QStringLiteral ( " shp" ) );
4614
4614
QVERIFY ( def->generateTemporaryDestination ().endsWith ( QStringLiteral ( " .shp" ) ) );
@@ -4724,7 +4724,7 @@ void TestQgsProcessing::parameterRasterOut()
4724
4724
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProcessingOutputLayerDefinition ( QgsProperty::fromValue ( " abc" ) ) ), context ), QStringLiteral ( " 'abc'" ) );
4725
4725
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProcessingOutputLayerDefinition ( QgsProperty::fromExpression ( " \" abc\" || \" def\" " ) ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" abc\" || \" def\" ')" ) );
4726
4726
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProperty::fromExpression ( " \" a\" =1" ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" a\" =1')" ) );
4727
- QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\' complex\' username=\" complex\" '" ) );
4727
+ QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\\ 'complex\\ ' username=\\\ " complex\\ \" '" ) );
4728
4728
4729
4729
QVariantMap map = def->toVariantMap ();
4730
4730
QgsProcessingParameterRasterDestination fromMap ( " x" );
@@ -4847,7 +4847,7 @@ void TestQgsProcessing::parameterFileOut()
4847
4847
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProcessingOutputLayerDefinition ( QgsProperty::fromValue ( " abc" ) ) ), context ), QStringLiteral ( " 'abc'" ) );
4848
4848
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProcessingOutputLayerDefinition ( QgsProperty::fromExpression ( " \" abc\" || \" def\" " ) ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" abc\" || \" def\" ')" ) );
4849
4849
QCOMPARE ( def->valueAsPythonString ( QVariant::fromValue ( QgsProperty::fromExpression ( " \" a\" =1" ) ), context ), QStringLiteral ( " QgsProperty.fromExpression('\" a\" =1')" ) );
4850
- QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\' complex\' username=\" complex\" '" ) );
4850
+ QCOMPARE ( def->valueAsPythonString ( " uri='complex' username=\" complex\" " , context ), QStringLiteral ( " 'uri=\\ 'complex\\ ' username=\\\ " complex\\ \" '" ) );
4851
4851
4852
4852
QVariantMap map = def->toVariantMap ();
4853
4853
QgsProcessingParameterFileDestination fromMap ( " x" );
0 commit comments