Skip to content

Commit

Permalink
Add test for qml feature
Browse files Browse the repository at this point in the history
  • Loading branch information
lo1ol committed Jun 27, 2022
1 parent 15a7380 commit d4a264c
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions test/data/javascript/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2578,6 +2578,69 @@ exports.test_data = {
input_: 'xml=<a b="c"><d/><e>\n foo</e>x</a>;',
output: 'xml = < a b = "c" > < d / > < e >\n foo < /e>x</a > ;'
}]
}, {
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: "",
Expand Down

0 comments on commit d4a264c

Please sign in to comment.