@@ -2962,7 +2962,11 @@ class TestQgsExpression: public QObject
2962
2962
QCOMPARE ( QgsExpression ( " map_concat(map('1', 'one', '2', 'overridden by next map'), map('2', 'two', '3', 'three'))" ).evaluate ( &context ), QVariant ( concatExpected ) );
2963
2963
2964
2964
QCOMPARE ( QgsExpression ( " json_to_map('{\" 1\" :\" one\" ,\" 2\" :\" two\" ,\" 3\" :\" three\" }')" ).evaluate ( &context ), QVariant ( concatExpected ) );
2965
+ QCOMPARE ( QgsExpression ( " load_json('{\" 1\" :\" one\" ,\" 2\" :\" two\" ,\" 3\" :\" three\" }')" ).evaluate ( &context ), QVariant ( concatExpected ) );
2966
+ QCOMPARE ( QgsExpression ( " load_json('[1,2,3]')" ).evaluate ( &context ), QVariant ( QVariantList () << 1 << 2 << 3 ) );
2965
2967
QCOMPARE ( QgsExpression ( " map_to_json(map('1','one','2','two','3','three'))" ).evaluate ( &context ), QVariant ( " {\" 1\" :\" one\" ,\" 2\" :\" two\" ,\" 3\" :\" three\" }" ) );
2968
+ QCOMPARE ( QgsExpression ( " write_json(map('1','one','2','two','3','three'))" ).evaluate ( &context ), QVariant ( " {\" 1\" :\" one\" ,\" 2\" :\" two\" ,\" 3\" :\" three\" }" ) );
2969
+ QCOMPARE ( QgsExpression ( " write_json(array(1,2,3))" ).evaluate ( &context ), QVariant ( QStringLiteral ( " [1,2,3]" ) ) );
2966
2970
2967
2971
QCOMPARE ( QgsExpression ( " hstore_to_map('1=>one,2=>two,3=>three')" ).evaluate ( &context ), QVariant ( concatExpected ) );
2968
2972
QCOMPARE ( QgsExpression ( " map_to_hstore(map('1','one','2','two','3','three'))" ).evaluate ( &context ), QVariant ( " \" 1\" =>\" one\" ,\" 2\" =>\" two\" ,\" 3\" =>\" three\" " ) );
0 commit comments