From e361a8f73a7c0ef8fa9dc013f136d295a3d01de5 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Wed, 17 Mar 2021 17:56:38 +0100 Subject: Improved property tree function names --- test/_props.scss | 60 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'test') 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 @@ ); @include assert-equal(iro-props-store($map), null, 'Save default tree'); - @include assert-equal(iro-props-clear(), null, 'Delete default tree'); + @include assert-equal(iro-props-clear(), null, 'Delete default tree'); } @include it('Read') { @@ -85,20 +85,20 @@ @include assert-equal(iro-props-store($map3, 'namespaced'), null, 'Save "namespaced" tree'); } - @include assert-equal(iro-props-get(--background), map-get($map1, --background), 'Get --background in default'); - @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'); - @include assert-equal(iro-props-get(--box, $default: false), false, 'Get nonexistent in default'); + @include assert-equal(iro-props-get-static(--background), map-get($map1, --background), 'Get --background in default'); + @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'); + @include assert-equal(iro-props-get-static(--box, $default: false), false, 'Get nonexistent in default'); - @include assert-equal(iro-props-get(--background, 'test'), map-get($map2, --background), 'Get --background in "test"'); - @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"'); - @include assert-equal(iro-props-get(--box, 'test', $default: false), false, 'Get nonexistent in "test"'); + @include assert-equal(iro-props-get-static(--background, 'test'), map-get($map2, --background), 'Get --background in "test"'); + @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"'); + @include assert-equal(iro-props-get-static(--box, 'test', $default: false), false, 'Get nonexistent in "test"'); - @include assert-equal(iro-props-get(--background, 'namespaced', $default: false), false, 'Get --background in "namespaced"'); - @include assert-equal(iro-props-get(--ns --background, 'namespaced'), map-get($map3, --background), 'Get --ns --background in "namespaced"'); + @include assert-equal(iro-props-get-static(--background, 'namespaced', $default: false), false, 'Get --background in "namespaced"'); + @include assert-equal(iro-props-get-static(--ns --background, 'namespaced'), map-get($map3, --background), 'Get --ns --background in "namespaced"'); @include iro-props-namespace('ns') { - @include assert-equal(iro-props-get(--background, 'namespaced'), map-get($map3, --background), 'Get namespaced --background in "namespaced"'); - @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"'); - @include assert-equal(iro-props-get(--box, 'namespaced', $default: false), false, 'Get namespaced nonexistent in "namespaced"'); + @include assert-equal(iro-props-get-static(--background, 'namespaced'), map-get($map3, --background), 'Get namespaced --background in "namespaced"'); + @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"'); + @include assert-equal(iro-props-get-static(--box, 'namespaced', $default: false), false, 'Get namespaced nonexistent in "namespaced"'); } @include assert-equal(iro-props-clear(), null, 'Delete default tree'); @@ -130,10 +130,10 @@ @include assert-equal(iro-props-store($map1), null, 'Save default tree'); @include assert-equal(iro-props-store($map2, $merge: true), null, 'Overwrite default tree'); - @include assert-equal(iro-props-get(), iro-map-merge-recursive($map1, $map2), 'After update, get whole map'); - @include assert-equal(iro-props-get(--background), map-get($map2, --background), 'After update, get --background'); - @include assert-equal(iro-props-get(--text), map-get($map2, --text), 'After update, get --text'); - @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'); + @include assert-equal(iro-props-get-static(), iro-map-merge-recursive($map1, $map2), 'After update, get whole map'); + @include assert-equal(iro-props-get-static(--background), map-get($map2, --background), 'After update, get --background'); + @include assert-equal(iro-props-get-static(--text), map-get($map2, --text), 'After update, get --text'); + @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'); @include assert-equal(iro-props-clear(), null, 'Delete default tree'); } @@ -158,7 +158,7 @@ @include iro-props-store($map); @include output { - @include iro-props-assign-native; + @include iro-props-assign; } @include expect { @@ -177,7 +177,7 @@ @include iro-props-store($map); @include output { - @include iro-props-assign-native($skip: --buttons); + @include iro-props-assign($skip: --buttons); } @include expect { @@ -194,7 +194,7 @@ } @include output { - @include iro-props-assign-native; + @include iro-props-assign; } @include expect { @@ -228,12 +228,12 @@ @include assert-equal(iro-props-store($map), null, 'Save default tree'); - @include assert-equal(iro-props-get-native(--background), var(--background), 'Get --background'); - @include assert-equal(iro-props-get-native(--buttons --primary --text), var(--buttons--primary--text), 'Get --buttons --primary --text'); - @include assert-equal(iro-props-get-native(--buttons --secondary --text, $default: false), var(--buttons--secondary--text, false), 'Get --buttons --secondary --text with default'); + @include assert-equal(iro-props-get(--background), var(--background), 'Get --background'); + @include assert-equal(iro-props-get(--buttons --primary --text), var(--buttons--primary--text), 'Get --buttons --primary --text'); + @include assert-equal(iro-props-get(--buttons --secondary --text, $default: false), var(--buttons--secondary--text, false), 'Get --buttons --secondary --text with default'); @include iro-props-namespace('buttons') { - @include assert-equal(iro-props-get-native(--primary --text), var(--buttons--primary--text), 'Get via namespace "buttons" --primary --text'); - @include assert-equal(iro-props-get-native(--secondary --text, $default: false), var(--buttons--secondary--text, false), 'Get via namespace "buttons" --secondary --text with default'); + @include assert-equal(iro-props-get(--primary --text), var(--buttons--primary--text), 'Get via namespace "buttons" --primary --text'); + @include assert-equal(iro-props-get(--secondary --text, $default: false), var(--buttons--secondary--text, false), 'Get via namespace "buttons" --secondary --text with default'); } @include assert-equal(iro-props-clear(), null, 'Delete default tree'); @@ -264,16 +264,16 @@ @include assert-equal(iro-props-store($map1), null, 'Save default tree'); @include assert-equal(iro-props-store($map2, 'second'), null, 'Save "second" tree'); - @include assert-equal(iro-props-get(--buttons --primary --background, 'second'), map-get($map1, --background), 'Get referenced value'); - @include assert-equal(iro-props-get-native(--buttons --primary --background, 'second'), var(--buttons--primary--background), 'Get referenced value, native'); + @include assert-equal(iro-props-get-static(--buttons --primary --background, 'second'), map-get($map1, --background), 'Get referenced value'); + @include assert-equal(iro-props-get(--buttons --primary --background, 'second'), var(--buttons--primary--background), 'Get referenced value, native'); - @include assert-equal(iro-props-get(--buttons --default, 'second'), map-get(map-get($map1, --buttons), --primary), 'Get referenced subtree, whole'); - @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'); - @include assert-equal(iro-props-get-native(--buttons --default --background, 'second'), var(--buttons--default--background), 'Get referenced subtree, native'); + @include assert-equal(iro-props-get-static(--buttons --default, 'second'), map-get(map-get($map1, --buttons), --primary), 'Get referenced subtree, whole'); + @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'); + @include assert-equal(iro-props-get(--buttons --default --background, 'second'), var(--buttons--default--background), 'Get referenced subtree, native'); @include assert('Native assignment') { @include output { - @include iro-props-assign-native('second'); + @include iro-props-assign('second'); } @include expect { -- cgit v1.2.3-54-g00ecf