@include describe("Deep Equal") { @include it("should expect an equal deep list to be deep equal") { $list-1: false, (true, true); $list-2: "foo", ("bar", "baz"); $list-3: 100, (0.2, 12); $list-4: null, (null, false); @include should( expect( $list-1 ), to( deep-equal( $list-1 ))); @include should( expect( $list-2 ), to( deep-equal( $list-2 ))); @include should( expect( $list-3 ), to( deep-equal( $list-3 ))); @include should( expect( $list-4 ), to( deep-equal( $list-4 ))); } @include it("should expect an longer top level deep list not to be deep equal") { $list-1a: true, (true, (true)); $list-1b: true, true, (true, (true)); $list-2a: "foo", ("bar", ("baz")); $list-2b: "foo", "cha", ("bar", ("baz")); $list-3a: 100, (0.2, (12)); $list-3b: 100, 200, (0.2, (12)); $list-4a: null, (null, false); $list-4b: null, false, (null, false); @include should( expect( $list-1a ), not-to( deep-equal( $list-1b ))); @include should( expect( $list-2a ), not-to( deep-equal( $list-2b ))); @include should( expect( $list-3a ), not-to( deep-equal( $list-3b ))); @include should( expect( $list-4a ), not-to( deep-equal( $list-4b ))); } @include it("should expect an longer inner level deep list not to be deep equal") { $list-1a: true, ( true, (true)); $list-1b: true, (true, true, (true)); $list-2a: "foo", ( "bar", ("baz")); $list-2b: "foo", ("cha", "bar", ("baz")); $list-3a: 100, ( 0.2, 12); $list-3b: 100, (200, 0.2, 12); $list-4a: null, ( null, false); $list-4b: null, (false, null, false); @include should( expect( $list-1a ), not-to( deep-equal( $list-1b ))); @include should( expect( $list-2a ), not-to( deep-equal( $list-2b ))); @include should( expect( $list-3a ), not-to( deep-equal( $list-3b ))); @include should( expect( $list-4a ), not-to( deep-equal( $list-4b ))); } @include it("should expect an deep list with a different top level value not to be deep equal") { $list-1a: true, (true, (true)); $list-1b: false, (true, (true)); $list-2a: "foo", ("bar", ("baz")); $list-2b: "bar", ("bar", ("baz")); $list-3a: 100, (0.2, (12)); $list-3b: 200, (0.2, (12)); $list-4a: null, (null, false); $list-4b: false, (null, false); @include should( expect( $list-1a ), not-to( deep-equal( $list-1b ))); @include should( expect( $list-2a ), not-to( deep-equal( $list-2b ))); @include should( expect( $list-3a ), not-to( deep-equal( $list-3b ))); @include should( expect( $list-4a ), not-to( deep-equal( $list-4b ))); } @include it("should expect an deep list with a different inner level value not to be deep equal") { $list-1a: true, (false, (true)); $list-1b: true, (true, (true)); $list-2a: "foo", ("bar", ("baz")); $list-2b: "foo", ("foo", ("baz")); $list-3a: 100, (0.2, (12)); $list-3b: 100, (200, (12)); $list-4a: null, (false, (false)); $list-4b: null, (null, (false)); @include should( expect( $list-1a ), not-to( deep-equal( $list-1b ))); @include should( expect( $list-2a ), not-to( deep-equal( $list-2b ))); @include should( expect( $list-3a ), not-to( deep-equal( $list-3b ))); @include should( expect( $list-4a ), not-to( deep-equal( $list-4b ))); } @include it("should expect an equal non-deep list to be deep equal") { $list-1a: true, false, true; $list-1b: true, false, true; $list-2a: "foo", "bar", "baz"; $list-2b: "foo", "bar", "baz"; $list-3a: 100, 0.2, 12; $list-3b: 100, 0.2, 12; $list-4a: false, null, false; $list-4b: false, null, false; @include should( expect( $list-1a ), to( deep-equal( $list-1b ))); @include should( expect( $list-2a ), to( deep-equal( $list-2b ))); @include should( expect( $list-3a ), to( deep-equal( $list-3b ))); @include should( expect( $list-4a ), to( deep-equal( $list-4b ))); } @include it("should expect an unequal non-deep list to be deep equal") { $list-1a: true, false, true; $list-1b: true, true, true; $list-2a: "foo", "bar", "baz"; $list-2b: "foo", "cha", "baz"; $list-3a: 100, 0.2, 12; $list-3b: 200, 0.2, 12; $list-4a: false, null, false; $list-4b: false, false, false; @include should( expect( $list-1a ), not-to( deep-equal( $list-1b ))); @include should( expect( $list-2a ), not-to( deep-equal( $list-2b ))); @include should( expect( $list-3a ), not-to( deep-equal( $list-3b ))); @include should( expect( $list-4a ), not-to( deep-equal( $list-4b ))); } @include it("should expect other equal values to be deep equal") { @include should( expect( true ), to( deep-equal( true ))); @include should( expect( "foo" ), to( deep-equal( "foo" ))); @include should( expect( 1 ), to( deep-equal( 1 ))); @include should( expect( null ), to( deep-equal( null ))); @include should( expect( false ), to( deep-equal( false ))); } @include it("should expect other unequal values to be deep equal") { @include should( expect( true ), not-to( deep-equal( false ))); @include should( expect( "foo" ), not-to( deep-equal( "bar" ))); @include should( expect( 1 ), not-to( deep-equal( 2 ))); @include should( expect( null ), not-to( deep-equal( false ))); @include should( expect( false ), not-to( deep-equal( null ))); } @include it("should expect empty lists to be deep equal") { @include should( expect( () ), to( deep-equal( () ))); @include should( expect( () ), to( deep-equal( () ))); @include should( expect( () ), to( deep-equal( () ))); @include should( expect( () ), to( deep-equal( () ))); @include should( expect( () ), to( deep-equal( () ))); } }