From d4a264c7ed1380fda4668664598597c6f61e218e Mon Sep 17 00:00:00 2001 From: Petr Mikhalicin Date: Mon, 27 Jun 2022 11:51:02 +0300 Subject: [PATCH] Add test for qml feature --- test/data/javascript/tests.js | 63 +++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/test/data/javascript/tests.js b/test/data/javascript/tests.js index 367c3e231..29b97606a 100644 --- a/test/data/javascript/tests.js +++ b/test/data/javascript/tests.js @@ -2578,6 +2578,69 @@ exports.test_data = { input_: 'xml=\n foox;', output: 'xml = < a b = "c" > < d / > < e >\n foo < /e>x ;' }] + }, { + name: "qml true", + description: "", + options: [ + { name: 'qml', value: true } + ], + tests: [ + { unchanged: 'property var x = {};' }, + { unchanged: 'readonly property var x = {};' }, + { + unchanged: [ + '// MessageLabel.qml', + 'import QtQuick', + '', + 'Rectangle {', + ' height: 50', + ' property string message: "debug message"', + ' property var msgType: ["debug", "warning", "critical"]', + ' color: "black"', + '', + ' Column {', + ' anchors.fill: parent', + ' padding: 5.0', + ' spacing: 2', + ' Text {', + ' text: msgType.toString().toUpperCase() + ":"', + ' font.bold: msgType == "critical"', + ' font.family: "Terminal Regular"', + ' color: msgType === "warning" || msgType === "critical" ? "red" : "yellow"', + ' ColorAnimation on color {', + ' running: msgType == "critical"', + ' from: "red"', + ' to: "black"', + ' duration: 1000', + ' loops: msgType == "critical" ? Animation.Infinite : 1', + ' }', + ' }', + ' Text {', + ' text: message', + ' color: msgType === "warning" || msgType === "critical" ? "red" : "yellow"', + ' font.family: "Terminal Regular"', + ' }', + ' }', + '}' + ] + } + ] + }, { + name: "qml false", + description: "", + options: [ + { name: 'qml', value: false } + ], + tests: [ + { + input: 'property var x = {};', + output: 'property\nvar x = {};' + }, + { + input: 'readonly property var x = {};', + output: 'readonly property\nvar x = {};' + } + ] }, { name: "Multiple braces", description: "",