Sha256: 52d477f70620221295ce731a81bd66919be3485e3bc88a4b7c4555ecca3892ff
Contents?: true
Size: 1.34 KB
Versions: 51
Compression:
Stored size: 1.34 KB
Contents
@function deep-equal($expected) { $when: true; $actual: actual(); $contains-list: true; $temp-1: $actual; $temp-2: $expected; @while $contains-list { $contains-list: false; @if length($temp-1) == length($temp-2) { @for $n from 1 through length($temp-1) { $temp-1-item: nth($temp-1, $n); $temp-2-item: nth($temp-2, $n); @if type-of($temp-1-item) == "list" and type-of($temp-2-item) == "list" { @if length($temp-1-item) == length($temp-2-item) { @for $_n from 1 through length($temp-1-item) { $_temp-1-item: nth($temp-1-item, $_n); $_temp-2-item: nth($temp-2-item, $_n); @if type-of($_temp-1-item) == "list" and type-of($_temp-2-item) == "list" { $contains-list: true; } @else if $_temp-1-item != $_temp-2-item { $when: false; } $temp-1: $_temp-1-item; $temp-2: $_temp-2-item; } } @else { $when: false; } } @else if $temp-1-item != $temp-2-item { $when: false; } } } @else { $when: false; } } $throw: error("dep", "The `deep-equal` matcher has been deprecated, please use the `be` matcher for the same functionality"); @return should("deep equal", $expected, $when); }
Version data entries
51 entries across 51 versions & 2 rubygems