forked from qt-creator/qt-creator
On macOS, files in Contents/PlugIns/ need to be codesigned individually. Since Lua plugins are not really binaries, per Apple's documentation that is to be avoided (and we currently only sign executables there). Just move Lua plugins generally to the resources directory, like we do for other scripts like the debugger Python scripts, and load them from there. Change-Id: Idabd6b7c0c7c6e842b1752488cb7073f00e7be49 Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
39 lines
1.1 KiB
Lua
39 lines
1.1 KiB
Lua
-- Copyright (C) 2024 The Qt Company Ltd.
|
|
-- SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
|
|
local T = require("qtctest")
|
|
local fetch = require("Fetch").fetch
|
|
local inspect = require('inspect')
|
|
local a = require("async")
|
|
local string = require("string")
|
|
|
|
local function testFetch()
|
|
local r = a.wait(fetch({ url = "https://dummyjson.com/products", convertToTable = true }))
|
|
local y = a.wait(fetch({ url = "https://dummyjson.com/products", convertToTable = true }))
|
|
T.compare(type(r), "table")
|
|
T.compare(type(y), "table")
|
|
end
|
|
|
|
local function testGoogle()
|
|
local r = a.wait(fetch({ url = "https://www.google.com" }))
|
|
T.compare(r.error, 0)
|
|
print(r)
|
|
end
|
|
|
|
local function fetchTwo()
|
|
local r = a.wait_all {
|
|
fetch({ url = "https://dummyjson.com/products", convertToTable = true }),
|
|
fetch({ url = "https://www.google.com" }),
|
|
}
|
|
|
|
T.compare(type(r), "table")
|
|
T.compare(#r, 2)
|
|
T.compare(type(r[1]), "table")
|
|
T.compare(r[2].error, 0)
|
|
end
|
|
|
|
return {
|
|
testFetch = testFetch,
|
|
testGoogle = testGoogle,
|
|
testFetchTwo = fetchTwo
|
|
}
|