Skip to content

Instantly share code, notes, and snippets.

@adamcameron
Last active December 21, 2015 10:29
Show Gist options
  • Save adamcameron/6292430 to your computer and use it in GitHub Desktop.
Save adamcameron/6292430 to your computer and use it in GitHub Desktop.
Cross-platform version of Aurel's code
<cfscript>
void function test(string title, array values) {
writeOutput("<h3>#title#</h3>");
for (var v in values) {
writeDump(var=v,expand=false);
try {
b = v ? true : false;
writeOutput ("#v# is true: #b#");
} catch (any e) {
writeOutput ("#e.message# #e.detail#");
}
writeOutput ("<br/>");
}
writeOutput ("<hr size='1'/>");
}
test("booleans",[false, true]);
test("numerics", [-2, -1, 0, 1, 2]);
test("strings", ["", "something", "1", "0"]);
test("arrays", [[], [1], [1, 2], ["something"]]);
test("structs", [{}, {a= 1}, {a= 1, b=2}, {a= "something"}]);
test("queries", [queryNew("")]); // test object
</cfscript>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment