test_hostnameIsSharedIPAddress.js (432B)
1 "use strict"; 2 3 function run_test() { 4 let testURIs = [ 5 // 100.64/10 prefix (RFC 6598) 6 ["http://100.63.255.254", false], 7 ["http://100.64.0.0", true], 8 ["http://100.91.63.42", true], 9 ["http://100.127.255.254", true], 10 ["http://100.128.0.0", false], 11 ]; 12 13 for (let [uri, isShared] of testURIs) { 14 let nsuri = Services.io.newURI(uri); 15 equal(isShared, Services.io.hostnameIsSharedIPAddress(nsuri)); 16 } 17 }