diff options
| author | Volpeon <git@volpeon.ink> | 2022-02-07 12:28:59 +0100 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2022-02-07 12:28:59 +0100 |
| commit | 4c9a427806b47b916849dbc98330fdbb469b659b (patch) | |
| tree | 5dc85968bea6569aa4ff47c46e5d4994a24cdcaf /test/_functions.scss | |
| parent | Rename next-twin-element to next-twin-elem (diff) | |
| download | iro-sass-4c9a427806b47b916849dbc98330fdbb469b659b.tar.gz iro-sass-4c9a427806b47b916849dbc98330fdbb469b659b.tar.bz2 iro-sass-4c9a427806b47b916849dbc98330fdbb469b659b.zip | |
Replace deep map functions with built-ins
Diffstat (limited to 'test/_functions.scss')
| -rw-r--r-- | test/_functions.scss | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/test/_functions.scss b/test/_functions.scss index 2430f28..07561ef 100644 --- a/test/_functions.scss +++ b/test/_functions.scss | |||
| @@ -41,55 +41,6 @@ | |||
| 41 | @include assert-equal(functions.map-get-default($map, 'index', 'nothing'), 'nothing', 'Get missing value'); | 41 | @include assert-equal(functions.map-get-default($map, 'index', 'nothing'), 'nothing', 'Get missing value'); |
| 42 | } | 42 | } |
| 43 | 43 | ||
| 44 | @include it('map-get-deep') { | ||
| 45 | $map: ( | ||
| 46 | 'key': 'value', | ||
| 47 | 'sub': ( | ||
| 48 | 'item1': 1, | ||
| 49 | 'item2': 2, | ||
| 50 | 'subsub': ( | ||
| 51 | 'item1': 11, | ||
| 52 | 'item2': 12, | ||
| 53 | ) | ||
| 54 | ) | ||
| 55 | ); | ||
| 56 | |||
| 57 | @include assert-equal(functions.map-get-deep($map, 'key'), map-get($map, 'key'), 'Get value in root level'); | ||
| 58 | @include assert-equal(functions.map-get-deep($map, 'sub' 'item1'), map-get(map-get($map, 'sub'), 'item1'), 'Get value in first level'); | ||
| 59 | @include assert-equal(functions.map-get-deep($map, 'sub' 'item2'), map-get(map-get($map, 'sub'), 'item2'), 'Get value in first level'); | ||
| 60 | @include assert-equal(functions.map-get-deep($map, 'sub' 'subsub' 'item1'), map-get(map-get(map-get($map, 'sub'), 'subsub'), 'item1'), 'Get value in second level'); | ||
| 61 | @include assert-equal(functions.map-get-deep($map, 'sub' 'subsub' 'item2'), map-get(map-get(map-get($map, 'sub'), 'subsub'), 'item2'), 'Get value in second level'); | ||
| 62 | } | ||
| 63 | |||
| 64 | @include it('map-merge-recursive') { | ||
| 65 | $map1: ( | ||
| 66 | 'key': 'value', | ||
| 67 | 'sub': ( | ||
| 68 | 'item1': 1, | ||
| 69 | 'item3': 2 | ||
| 70 | ) | ||
| 71 | ); | ||
| 72 | $map2: ( | ||
| 73 | 'another': 'item', | ||
| 74 | 'sub': ( | ||
| 75 | 'item1': 0, | ||
| 76 | 'item2': 1 | ||
| 77 | ) | ||
| 78 | ); | ||
| 79 | |||
| 80 | $expected: ( | ||
| 81 | 'key': 'value', | ||
| 82 | 'another': 'item', | ||
| 83 | 'sub': ( | ||
| 84 | 'item1': 0, | ||
| 85 | 'item2': 1, | ||
| 86 | 'item3': 2 | ||
| 87 | ) | ||
| 88 | ); | ||
| 89 | |||
| 90 | @include assert-equal(functions.map-merge-recursive($map1, $map2), $expected); | ||
| 91 | } | ||
| 92 | |||
| 93 | @include it('strip-unit') { | 44 | @include it('strip-unit') { |
| 94 | @include assert-true(unitless(functions.strip-unit(1em)), 'Remove unit from 1em'); | 45 | @include assert-true(unitless(functions.strip-unit(1em)), 'Remove unit from 1em'); |
| 95 | @include assert-true(unitless(functions.strip-unit(2rem)), 'Remove unit from 2rem'); | 46 | @include assert-true(unitless(functions.strip-unit(2rem)), 'Remove unit from 2rem'); |
