Skip to content

Commit

Permalink
LDEV-4414 improve test, enable passing
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Jul 25, 2023
1 parent 6d53d3b commit ec18a6c
Showing 1 changed file with 54 additions and 12 deletions.
66 changes: 54 additions & 12 deletions test/tickets/LDEV4414.cfc
Original file line number Diff line number Diff line change
@@ -1,19 +1,61 @@
component extends="org.lucee.cfml.test.LuceeTestCase" skip="true" {
component extends="org.lucee.cfml.test.LuceeTestCase" {
function run( testResults, testBox ) {
describe("Testcase for LDEV-4414", function() {
it( title="checking ObjectEquals()", body=function( currentSpec ) {

it( title="checking ObjectEquals() simple string", body=function( currentSpec ) {
expect(ObjectEquals(
"PHONE",
"PHONE"
)).toBeTrue();
});

it( title="checking ObjectEquals() simple arrays", body=function( currentSpec ) {
expect(ObjectEquals(
["PHONE", "EMAIL"],
["PHONE", "EMAIL"]
)).toBeTrue();
});

it( title="checking ObjectEquals() nested arrays, different", skip=true, body=function( currentSpec ) {
expect(ObjectEquals(
[["PHONE", "EMAIL"], ["PHONE"], ["PHONE", "EMAIL"]],
[["PHONE", "EMAIL"], ["PHONE"], ["PHONE"]]))
.toBeFalse();
expect(ObjectEquals(
{ id: 1, name: 'Lucee' },
{ id: 1, name: 'Lucee' }))
.toBeTrue()
expect(ObjectEquals(
{ id: 1, name: 'Lucee' },
{ id: 1, name: 'Lucee', type: "language" }))
.toBeFalse();
[["PHONE", "EMAIL"], ["PHONE"], ["PHONE"]]
)).toBeFalse();
});

it( title="checking ObjectEquals() nested arrays, same", body=function( currentSpec ) {
expect(ObjectEquals(
[["PHONE", "EMAIL"], ["PHONE"], ["PHONE", "EMAIL"]],
[["PHONE", "EMAIL"], ["PHONE"], ["PHONE", "EMAIL"]]
)).toBeTrue();
});

it( title="checking ObjectEquals() simple struct same", body=function( currentSpec ) {
expect(ObjectEquals(
{ id: 1, name: 'Lucee' },
{ id: 1, name: 'Lucee' }
)).toBeTrue();
});

it( title="checking ObjectEquals() simple struct different", body=function( currentSpec ) {
expect(ObjectEquals(
{ id: 1, name: 'Lucee' },
{ id: 1, name: 'Lucee', type: "language" }
)).toBeFalse();
});

it( title="checking ObjectEquals() nested struct different", body=function( currentSpec ) {
expect(ObjectEquals(
{ id: 1, name: { engine: 'Lucee'} },
{ id: 1, name: { engine: 'ACF'} }
)).toBeFalse();
});

it( title="checking ObjectEquals() nested struct, different arrays", body=function( currentSpec ) {
expect(ObjectEquals(
{ id: 1, name: [ 'engine', 'Lucee'] },
{ id: 1, name: [ 'engine', 'ACF'] }
)).toBeFalse();
});
});
}
Expand Down

0 comments on commit ec18a6c

Please sign in to comment.