mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-09-30 13:05:43 +00:00
lua: lower camel case
This commit is contained in:
@@ -48,7 +48,7 @@ assert(by_id.primary and by_id.fallback, "primary and fallback DNS servers are r
|
||||
|
||||
function handleDNSQuery(q)
|
||||
local answer = by_id.primary:query(q)
|
||||
if not answer.error and us_ips:AnyMatch(answer.ips) then
|
||||
if not answer.error and us_ips:anyMatch(answer.ips) then
|
||||
return answer
|
||||
end
|
||||
return by_id.fallback:query(q)
|
||||
|
||||
@@ -16,12 +16,12 @@ func TestLuaIPMatcherAcceptsNativeIP(t *testing.T) {
|
||||
L.SetGlobal("ip", ip)
|
||||
if err := L.DoString(`
|
||||
local matcher = require("xray.geodata").ipMatcher({"127.0.0.0/8"})
|
||||
assert(matcher:Match(ip))
|
||||
assert(matcher:AnyMatch({ip}))
|
||||
assert(matcher:Matches({ip}))
|
||||
local matched, unmatched = matcher:FilterIPs({ip})
|
||||
assert(matcher:match(ip))
|
||||
assert(matcher:anyMatch({ip}))
|
||||
assert(matcher:matches({ip}))
|
||||
local matched, unmatched = matcher:filterIPs({ip})
|
||||
assert(#matched == 1 and #unmatched == 0)
|
||||
assert(matcher:Match(matched[1]))
|
||||
assert(matcher:match(matched[1]))
|
||||
`); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -33,9 +33,9 @@ func TestLuaDomainMatcherUsesNativeMatcher(t *testing.T) {
|
||||
RegisterLua(L)
|
||||
if err := L.DoString(`
|
||||
local matcher = require("xray.geodata").domainMatcher({"example.com"})
|
||||
assert(matcher:MatchAny("example.com"))
|
||||
assert(matcher:MatchAny("www.example.com"))
|
||||
assert(#(matcher:Match("www.example.com")) == 1)
|
||||
assert(matcher:matchAny("example.com"))
|
||||
assert(matcher:matchAny("www.example.com"))
|
||||
assert(#(matcher:match("www.example.com")) == 1)
|
||||
`); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user