-
-
Save peterkir/f215375b9e2d1f1ccc0a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env jjs | |
function runTest() { | |
var URL = Packages.java.net.URL; | |
var LinkedHashSet = Packages.java.util.LinkedHashSet; | |
set = new LinkedHashSet(); | |
set.add(new URL("http://Square.GitHub.io/")); | |
set.add(new URL("http://square.github.io:80/")); | |
set.add(new URL("http://google.github.io/")); | |
size = set.size(); | |
if (size === 2) { | |
print("============= CORRECT ==========="); | |
} else { | |
print("Awkward... "); | |
} | |
} | |
function callExternalNashorn() { | |
for (i = 0; i < 100; i++) { | |
script = __FILE__; | |
$EXEC('jjs -Dsanity=true -scripting ' + script); | |
print($OUT); | |
} | |
} | |
if (java.lang.System.getProperty("sanity") === "true") { | |
runTest(); | |
} else { | |
callExternalNashorn(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment