View isObjectLuceeBungnessTest.cfm
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
<cfscript> | |
function run() { | |
describe("Comparing behaviour of isObject across CF and Lucee", () => { | |
describe("Tests using isObject", () => { | |
describe("Tests when argument is scoped", () => { | |
var isObjectChecker = (component object) => isObject(arguments.object) | |
it("is a baseline happy path", () => { | |
var o = new Http() | |
expect(isObjectChecker(o)).toBeTrue() |
View tinyTestFramework.cfm
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
<style> | |
.tinyTest {background-color: black; color:white; font-family:monospace} | |
.tinyTest div {margin-left: 1em} | |
.tinyTest .pass {color:green;} | |
.tinyTest .fail {color:red;} | |
.tinyTest .error {background-color:red; color:black} | |
</style> | |
<cfscript> | |
tinyTest = { |
View Numbers.cfc
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
component extends=Controller { | |
function init() { | |
filters("getHeadersForRequest") | |
} | |
function getHeadersForRequest() { | |
variables.headers = getHttpRequestData().headers | |
} |
View result.out
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
Tags | |
[#arguments.x#] [2] | |
Script | |
[#arguments.x#] [#arguments.x#] |
View build.gradle.kts
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
val ktor_version: String by project | |
val kotlin_version: String by project | |
val logback_version: String by project | |
plugins { | |
application | |
kotlin("jvm") version "1.7.20" | |
id("io.ktor.plugin") version "2.1.2" | |
} |
View trycf-gist-1663831519549-108be4c3-5b4d-d6dc-ca88-c0d8e48bcdb6.cfm
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
<cfscript> | |
s = "12345678901234567890" | |
writeDump([ | |
"s" = s, | |
"val(s)" = val(s), | |
"s.getClass().getName()" = s.getClass().getName(), | |
"val(s).getClass().getName()" = val(s).getClass().getName() | |
]) | |
d = 12345678901234567890 |
View code.cfm
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
function index( event, rc, prc ){ | |
prc.pageTitle = "Reset Password"; | |
if( isEmpty( rc?.user ) || isEmpty( rc?.token ) ) { | |
return event.setView( "resetpassword/malformedurl" ); | |
} | |
var rows = getInstance( "User" ).firstWhere( "id", rc.user ); | |
if( isNull( rows ) ) { | |
return event.setView( "resetpassword/malformedurl" ); |
View ttfOtherFunctionsTest.cfm
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
<cfscript> | |
void function run() { | |
describe("Tests of it", () => { | |
it("prefixes its message with ""It""", () => { | |
savecontent variable="message" { | |
it("IS A TEST MESSAGE", () => {}) | |
} | |
tinyTest.results.pass-- | |
expect(message).toInclude("It IS A TEST MESSAGE") | |
}) |
View testHarness.cfm
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
<cfscript> | |
cfhttp( | |
method = "get", | |
url = "https://gist.githubusercontent.com/adamcameron/816ce84fd991c2682df612dbaf1cad11/raw/tinyTestFramework.cfm", | |
result = "frameworkCodeResponse", | |
throwOnError = true | |
); | |
frameworkCode = frameworkCodeResponse.fileContent; |
View ttfMatcherFunctionsTest.cfm
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
<cfscript> | |
void function run() { | |
describe("Tests of toBe", () => { | |
it("passes if the actual and expected values are equal", () => { | |
var actual = "TEST_VALUE" | |
var expected = "TEST_VALUE" | |
result = expect(actual).toBe(expected) | |
if (isNull(result) || !result) { | |
throw(type="TinyTest.TestFailedException") |
NewerOlder