add tests to github actions

This commit is contained in:
Pierce 2023-08-12 13:04:20 -04:00
parent 9ac967db05
commit 34a07f9e2b
No known key found for this signature in database
GPG Key ID: EC79465B0E865E47
4 changed files with 27 additions and 19 deletions

8
.github/workflows/gluatest.yml vendored Normal file
View File

@ -0,0 +1,8 @@
name: GLuaTest Runner
on:
pull_request:
jobs:
run-tests:
uses: CFC-Servers/GLuaTest/.github/workflows/gluatest.yml@main

View File

@ -20,7 +20,7 @@ local function logRequest( method, url, fileLocation, allowed, noisy )
if not url then
url = "unknown"
elseif isVerbose == false then
local address = CFCHTTP.getAddress( url )
local address = CFCHTTP.GetAddress( url )
if noisy then return end
url = address

View File

@ -1,23 +1,5 @@
CFCHTTP = CFCHTTP or {}
local parsedAddressCache = {}
---@parm url string
---@return string
function CFCHTTP.getAddress( url )
local cached = parsedAddressCache[url]
if cached then return cached end
local data = CFCHTTP.ParseURL( url )
parsedAddressCache[url] = data.address
return data.address
end
function CFCHTTP.isAssetURI( url )
return string.StartWith( url, "asset://" )
end
-- escapes all lua pattern characters and allows the use of * as a wildcard
local escapedCache = {}
local function escapeAddr( addr )

View File

@ -33,3 +33,21 @@ function CFCHTTP.FindURLs( text )
return urls
end
local parsedAddressCache = {}
---@parm url string
---@return string
function CFCHTTP.GetAddress( url )
local cached = parsedAddressCache[url]
if cached then return cached end
local data = CFCHTTP.ParseURL( url )
parsedAddressCache[url] = data.address
return data.address
end
function CFCHTTP.IsAssetURI( url )
return string.StartWith( url, "asset://" )
end