diff options
author | Matthew Wild <mwild1@gmail.com> | 2024-02-23 12:03:31 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2024-02-23 12:03:31 +0000 |
commit | 1606675762e0ac0d9609d6d5b1d69492d2e29abb (patch) | |
tree | 84c4a081b349aa02d8ddf923947e4df6d1bdbbce /spec | |
parent | 81cb34ef502c6f8fb8378740fb695214988dde31 (diff) | |
download | prosody-1606675762e0ac0d9609d6d5b1d69492d2e29abb.tar.gz prosody-1606675762e0ac0d9609d6d5b1d69492d2e29abb.zip |
util.ip: Add another test case for match() and commonPrefixLength()
Diffstat (limited to 'spec')
-rw-r--r-- | spec/util_ip_spec.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/util_ip_spec.lua b/spec/util_ip_spec.lua index 2725ba3a..a0287ee7 100644 --- a/spec/util_ip_spec.lua +++ b/spec/util_ip_spec.lua @@ -36,6 +36,8 @@ describe("util.ip", function() assert.are.equal(match(_"8.8.8.8", _"8.8.0.0", 16), true); assert.are.equal(match(_"8.8.4.4", _"8.8.0.0", 16), true); + + assert.are.equal(match(_"fe80::1", _"fec0::", 10), false); end); end); @@ -98,6 +100,8 @@ describe("util.ip", function() assert_cpl6("abcd::1", "abcd::1", 128); assert_cpl6("abcd::abcd", "abcd::", 112); assert_cpl6("abcd::abcd", "abcd::abcd:abcd", 96); + + assert_cpl6("fe80::1", "fec0::", 9); end); end); |