diff options
author | Volpeon <git@volpeon.ink> | 2021-03-17 17:56:38 +0100 |
---|---|---|
committer | Volpeon <git@volpeon.ink> | 2021-03-17 17:56:38 +0100 |
commit | e361a8f73a7c0ef8fa9dc013f136d295a3d01de5 (patch) | |
tree | 62872558fcbed9c9300db74d718dd278eb19adca /test | |
parent | Added namespaces and shortcodes for property trees (diff) | |
download | iro-sass-e361a8f73a7c0ef8fa9dc013f136d295a3d01de5.tar.gz iro-sass-e361a8f73a7c0ef8fa9dc013f136d295a3d01de5.tar.bz2 iro-sass-e361a8f73a7c0ef8fa9dc013f136d295a3d01de5.zip |
Improved property tree function names
Diffstat (limited to 'test')
-rw-r--r-- | test/_props.scss | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/test/_props.scss b/test/_props.scss index 982fc2f..021ed4c 100644 --- a/test/_props.scss +++ b/test/_props.scss | |||
@@ -41,7 +41,7 @@ | |||
41 | ); | 41 | ); |
42 | 42 | ||
43 | @include assert-equal(iro-props-store($map), null, 'Save default tree'); | 43 | @include assert-equal(iro-props-store($map), null, 'Save default tree'); |
44 | @include assert-equal(iro-props-clear(), null, 'Delete default tree'); | 44 | @include assert-equal(iro-props-clear(), null, 'Delete default tree'); |
45 | } | 45 | } |
46 | 46 | ||
47 | @include it('Read') { | 47 | @include it('Read') { |
@@ -85,20 +85,20 @@ | |||
85 | @include assert-equal(iro-props-store($map3, 'namespaced'), null, 'Save "namespaced" tree'); | 85 | @include assert-equal(iro-props-store($map3, 'namespaced'), null, 'Save "namespaced" tree'); |
86 | } | 86 | } |
87 | 87 | ||
88 | @include assert-equal(iro-props-get(--background), map-get($map1, --background), 'Get --background in default'); | 88 | @include assert-equal(iro-props-get-static(--background), map-get($map1, --background), 'Get --background in default'); |
89 | @include assert-equal(iro-props-get(--buttons --primary --background), map-get(map-get(map-get($map1, --buttons), --primary), --background), 'Get --buttons --primary --background in default'); | 89 | @include assert-equal(iro-props-get-static(--buttons --primary --background), map-get(map-get(map-get($map1, --buttons), --primary), --background), 'Get --buttons --primary --background in default'); |
90 | @include assert-equal(iro-props-get(--box, $default: false), false, 'Get nonexistent in default'); | 90 | @include assert-equal(iro-props-get-static(--box, $default: false), false, 'Get nonexistent in default'); |
91 | 91 | ||
92 | @include assert-equal(iro-props-get(--background, 'test'), map-get($map2, --background), 'Get --background in "test"'); | 92 | @include assert-equal(iro-props-get-static(--background, 'test'), map-get($map2, --background), 'Get --background in "test"'); |
93 | @include assert-equal(iro-props-get(--buttons --primary --background, 'test'), map-get(map-get(map-get($map2, --buttons), --primary), --background), 'Get --buttons --primary --background in "test"'); | 93 | @include assert-equal(iro-props-get-static(--buttons --primary --background, 'test'), map-get(map-get(map-get($map2, --buttons), --primary), --background), 'Get --buttons --primary --background in "test"'); |
94 | @include assert-equal(iro-props-get(--box, 'test', $default: false), false, 'Get nonexistent in "test"'); | 94 | @include assert-equal(iro-props-get-static(--box, 'test', $default: false), false, 'Get nonexistent in "test"'); |
95 | 95 | ||
96 | @include assert-equal(iro-props-get(--background, 'namespaced', $default: false), false, 'Get --background in "namespaced"'); | 96 | @include assert-equal(iro-props-get-static(--background, 'namespaced', $default: false), false, 'Get --background in "namespaced"'); |
97 | @include assert-equal(iro-props-get(--ns --background, 'namespaced'), map-get($map3, --background), 'Get --ns --background in "namespaced"'); | 97 | @include assert-equal(iro-props-get-static(--ns --background, 'namespaced'), map-get($map3, --background), 'Get --ns --background in "namespaced"'); |
98 | @include iro-props-namespace('ns') { | 98 | @include iro-props-namespace('ns') { |
99 | @include assert-equal(iro-props-get(--background, 'namespaced'), map-get($map3, --background), 'Get namespaced --background in "namespaced"'); | 99 | @include assert-equal(iro-props-get-static(--background, 'namespaced'), map-get($map3, --background), 'Get namespaced --background in "namespaced"'); |
100 | @include assert-equal(iro-props-get(--buttons --primary --background, 'namespaced'), map-get(map-get(map-get($map3, --buttons), --primary), --background), 'Get namespaced --buttons --primary --background in "namespaced"'); | 100 | @include assert-equal(iro-props-get-static(--buttons --primary --background, 'namespaced'), map-get(map-get(map-get($map3, --buttons), --primary), --background), 'Get namespaced --buttons --primary --background in "namespaced"'); |
101 | @include assert-equal(iro-props-get(--box, 'namespaced', $default: false), false, 'Get namespaced nonexistent in "namespaced"'); | 101 | @include assert-equal(iro-props-get-static(--box, 'namespaced', $default: false), false, 'Get namespaced nonexistent in "namespaced"'); |
102 | } | 102 | } |
103 | 103 | ||
104 | @include assert-equal(iro-props-clear(), null, 'Delete default tree'); | 104 | @include assert-equal(iro-props-clear(), null, 'Delete default tree'); |
@@ -130,10 +130,10 @@ | |||
130 | @include assert-equal(iro-props-store($map1), null, 'Save default tree'); | 130 | @include assert-equal(iro-props-store($map1), null, 'Save default tree'); |
131 | @include assert-equal(iro-props-store($map2, $merge: true), null, 'Overwrite default tree'); | 131 | @include assert-equal(iro-props-store($map2, $merge: true), null, 'Overwrite default tree'); |
132 | 132 | ||
133 | @include assert-equal(iro-props-get(), iro-map-merge-recursive($map1, $map2), 'After update, get whole map'); | 133 | @include assert-equal(iro-props-get-static(), iro-map-merge-recursive($map1, $map2), 'After update, get whole map'); |
134 | @include assert-equal(iro-props-get(--background), map-get($map2, --background), 'After update, get --background'); | 134 | @include assert-equal(iro-props-get-static(--background), map-get($map2, --background), 'After update, get --background'); |
135 | @include assert-equal(iro-props-get(--text), map-get($map2, --text), 'After update, get --text'); | 135 | @include assert-equal(iro-props-get-static(--text), map-get($map2, --text), 'After update, get --text'); |
136 | @include assert-equal(iro-props-get(--buttons --primary --text), map-get(map-get(map-get($map1, --buttons), --primary), --text), 'After update, get --buttons --primary --text'); | 136 | @include assert-equal(iro-props-get-static(--buttons --primary --text), map-get(map-get(map-get($map1, --buttons), --primary), --text), 'After update, get --buttons --primary --text'); |
137 | 137 | ||
138 | @include assert-equal(iro-props-clear(), null, 'Delete default tree'); | 138 | @include assert-equal(iro-props-clear(), null, 'Delete default tree'); |
139 | } | 139 | } |
@@ -158,7 +158,7 @@ | |||
158 | @include iro-props-store($map); | 158 | @include iro-props-store($map); |
159 | 159 | ||
160 | @include output { | 160 | @include output { |
161 | @include iro-props-assign-native; | 161 | @include iro-props-assign; |
162 | } | 162 | } |
163 | 163 | ||
164 | @include expect { | 164 | @include expect { |
@@ -177,7 +177,7 @@ | |||
177 | @include iro-props-store($map); | 177 | @include iro-props-store($map); |
178 | 178 | ||
179 | @include output { | 179 | @include output { |
180 | @include iro-props-assign-native($skip: --buttons); | 180 | @include iro-props-assign($skip: --buttons); |
181 | } | 181 | } |
182 | 182 | ||
183 | @include expect { | 183 | @include expect { |
@@ -194,7 +194,7 @@ | |||
194 | } | 194 | } |
195 | 195 | ||
196 | @include output { | 196 | @include output { |
197 | @include iro-props-assign-native; | 197 | @include iro-props-assign; |
198 | } | 198 | } |
199 | 199 | ||
200 | @include expect { | 200 | @include expect { |
@@ -228,12 +228,12 @@ | |||
228 | 228 | ||
229 | @include assert-equal(iro-props-store($map), null, 'Save default tree'); | 229 | @include assert-equal(iro-props-store($map), null, 'Save default tree'); |
230 | 230 | ||
231 | @include assert-equal(iro-props-get-native(--background), var(--background), 'Get --background'); | 231 | @include assert-equal(iro-props-get(--background), var(--background), 'Get --background'); |
232 | @include assert-equal(iro-props-get-native(--buttons --primary --text), var(--buttons--primary--text), 'Get --buttons --primary --text'); | 232 | @include assert-equal(iro-props-get(--buttons --primary --text), var(--buttons--primary--text), 'Get --buttons --primary --text'); |
233 | @include assert-equal(iro-props-get-native(--buttons --secondary --text, $default: false), var(--buttons--secondary--text, false), 'Get --buttons --secondary --text with default'); | 233 | @include assert-equal(iro-props-get(--buttons --secondary --text, $default: false), var(--buttons--secondary--text, false), 'Get --buttons --secondary --text with default'); |
234 | @include iro-props-namespace('buttons') { | 234 | @include iro-props-namespace('buttons') { |
235 | @include assert-equal(iro-props-get-native(--primary --text), var(--buttons--primary--text), 'Get via namespace "buttons" --primary --text'); | 235 | @include assert-equal(iro-props-get(--primary --text), var(--buttons--primary--text), 'Get via namespace "buttons" --primary --text'); |
236 | @include assert-equal(iro-props-get-native(--secondary --text, $default: false), var(--buttons--secondary--text, false), 'Get via namespace "buttons" --secondary --text with default'); | 236 | @include assert-equal(iro-props-get(--secondary --text, $default: false), var(--buttons--secondary--text, false), 'Get via namespace "buttons" --secondary --text with default'); |
237 | } | 237 | } |
238 | 238 | ||
239 | @include assert-equal(iro-props-clear(), null, 'Delete default tree'); | 239 | @include assert-equal(iro-props-clear(), null, 'Delete default tree'); |
@@ -264,16 +264,16 @@ | |||
264 | @include assert-equal(iro-props-store($map1), null, 'Save default tree'); | 264 | @include assert-equal(iro-props-store($map1), null, 'Save default tree'); |
265 | @include assert-equal(iro-props-store($map2, 'second'), null, 'Save "second" tree'); | 265 | @include assert-equal(iro-props-store($map2, 'second'), null, 'Save "second" tree'); |
266 | 266 | ||
267 | @include assert-equal(iro-props-get(--buttons --primary --background, 'second'), map-get($map1, --background), 'Get referenced value'); | 267 | @include assert-equal(iro-props-get-static(--buttons --primary --background, 'second'), map-get($map1, --background), 'Get referenced value'); |
268 | @include assert-equal(iro-props-get-native(--buttons --primary --background, 'second'), var(--buttons--primary--background), 'Get referenced value, native'); | 268 | @include assert-equal(iro-props-get(--buttons --primary --background, 'second'), var(--buttons--primary--background), 'Get referenced value, native'); |
269 | 269 | ||
270 | @include assert-equal(iro-props-get(--buttons --default, 'second'), map-get(map-get($map1, --buttons), --primary), 'Get referenced subtree, whole'); | 270 | @include assert-equal(iro-props-get-static(--buttons --default, 'second'), map-get(map-get($map1, --buttons), --primary), 'Get referenced subtree, whole'); |
271 | @include assert-equal(iro-props-get(--buttons --default --background, 'second'), map-get(map-get(map-get($map1, --buttons), --primary), --background), 'Get referenced subtree, inner value'); | 271 | @include assert-equal(iro-props-get-static(--buttons --default --background, 'second'), map-get(map-get(map-get($map1, --buttons), --primary), --background), 'Get referenced subtree, inner value'); |
272 | @include assert-equal(iro-props-get-native(--buttons --default --background, 'second'), var(--buttons--default--background), 'Get referenced subtree, native'); | 272 | @include assert-equal(iro-props-get(--buttons --default --background, 'second'), var(--buttons--default--background), 'Get referenced subtree, native'); |
273 | 273 | ||
274 | @include assert('Native assignment') { | 274 | @include assert('Native assignment') { |
275 | @include output { | 275 | @include output { |
276 | @include iro-props-assign-native('second'); | 276 | @include iro-props-assign('second'); |
277 | } | 277 | } |
278 | 278 | ||
279 | @include expect { | 279 | @include expect { |