diff options
Diffstat (limited to 'tests/auto/blackbox/testdata/jsextensions/propertylist.qbs')
-rw-r--r-- | tests/auto/blackbox/testdata/jsextensions/propertylist.qbs | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/jsextensions/propertylist.qbs b/tests/auto/blackbox/testdata/jsextensions/propertylist.qbs index cdd1c1af3..5b80eeafb 100644 --- a/tests/auto/blackbox/testdata/jsextensions/propertylist.qbs +++ b/tests/auto/blackbox/testdata/jsextensions/propertylist.qbs @@ -5,6 +5,32 @@ import qbs.TextFile Product { type: { + var plistobj = new PropertyList(); + if (!plistobj.isEmpty()) { + throw "newly created PropertyList was not empty!"; + } + + if (plistobj.format() !== undefined) { + throw "newly created PropertyList did not have an undefined format"; + } + + plistobj.clear(); + + if (!plistobj.isEmpty() || plistobj.format() !== undefined) { + throw "clear() somehow had an effect on an empty PropertyList"; + } + + plistobj.readFromString('{"key":["value"]}'); + if (plistobj.isEmpty() || plistobj.format() !== "json") { + throw "readFromString did not set format to JSON or object thinks it is empty"; + } + + plistobj.clear(); + + if (!plistobj.isEmpty() || plistobj.format() !== undefined) { + throw "clear() had no effect on a non-empty PropertyList"; + } + var obj = { "Array": ["ListItem1", "ListItem2", "ListItem3"], "Integer": 1, |