1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-27 18:09:01 +00:00

Add unittest.testing() to make test building conditional

This commit is contained in:
dmiller
2014-03-06 17:15:05 +00:00
parent f8242124b8
commit 88146749f6
5 changed files with 33 additions and 2 deletions

View File

@@ -655,6 +655,11 @@ hex_to_bin = function( hex )
end
--Ignore the rest if we are not testing.
if not unittest.testing() then
return _ENV
end
test_suite = unittest.TestSuite:new()
test_suite:add_test(unittest.is_true(isPrivate("192.168.123.123")), "192.168.123.123 is private")
test_suite:add_test(unittest.is_false(isPrivate("1.1.1.1")), "1.1.1.1 is not private")