aports/testing/lua-inet/fix-inet-check-error.patch
zhaixiaojuan 6c82231375 testing/lua-inet: fix inet check error
> Checking test/inet.lua                            5 warnings
>
>     test/inet.lua:161:9: 'not (x > y)' can be replaced by 'x <= y' (if neither side is a table or NaN)
>     test/inet.lua:165:9: 'not (x > y)' can be replaced by 'x <= y' (if neither side is a table or NaN)
>     test/inet.lua:166:9: 'not (x < y)' can be replaced by 'x >= y' (if neither side is a table or NaN)
>     test/inet.lua:167:9: 'not (x < y)' can be replaced by 'x >= y' (if neither side is a table or NaN)
>     test/inet.lua:171:9: 'not (x <= y)' can be replaced by 'x > y' (if neither side is a table or NaN)
>
> Total: 5 warnings / 0 errors in 11 files
> make: *** [Makefile:6: test] Error 123
2024-07-04 16:34:36 +00:00

27 lines
1.4 KiB
Diff

diff --git a/test/inet.lua b/test/inet.lua
index f2968bd..6ce1211 100644
--- a/test/inet.lua
+++ b/test/inet.lua
@@ -158,17 +158,17 @@ local function misc()
-- test inet4.__lt
assert(inet('10.0.0.0/24') < inet('10.0.0.0/30'), 'inet less than is broken')
- assert(not (inet('10.0.0.0/30') > inet('10.0.0.0/30')), 'inet less than is broken')
+ assert(inet('10.0.0.0/30') <= inet('10.0.0.0/30'), 'inet less than is broken')
assert(inet('10.0.0.0/30') >= inet('10.0.0.0/30'), 'inet less than is broken')
assert(inet('10.0.0.0/30') <= inet('10.0.0.0/30'), 'inet less than is broken')
assert(inet('10.0.0.0/30') > inet('10.0.0.0/24'), 'inet less than is broken')
- assert(not (inet('10.0.0.0/24') > inet('10.0.0.0/30')), 'inet less than is broken')
- assert(not (inet('10.0.0.0/30') < inet('10.0.0.0/30')), 'inet less than is broken')
- assert(not (inet('20.0.0.0/30') < inet('10.0.0.0/24')), 'inet less than is broken')
+ assert(inet('10.0.0.0/24') <= inet('10.0.0.0/30'), 'inet less than is broken')
+ assert(inet('10.0.0.0/30') >= inet('10.0.0.0/30'), 'inet less than is broken')
+ assert(inet('20.0.0.0/30') >= inet('10.0.0.0/24'), 'inet less than is broken')
-- test inet4.__le
assert(inet('10.0.1.2/24') <= inet('10.0.0.0/16'))
- assert(not (inet('10.0.1.0/24') <= inet('10.0.0.0/24')))
+ assert(inet('10.0.1.0/24') > inet('10.0.0.0/24'))
assert(inet('127.0.0.1/8'):netmask() == inet('255.0.0.0'))