From dd5f3c463fab336d694f426dcad11a1783590fc9 Mon Sep 17 00:00:00 2001 From: Volpeon Date: Sat, 5 Feb 2022 07:52:13 +0100 Subject: Ported from import syntax to modules --- test/_contexts.scss | 79 +++++++++++++++++++++++++++-------------------------- 1 file changed, 41 insertions(+), 38 deletions(-) (limited to 'test/_contexts.scss') diff --git a/test/_contexts.scss b/test/_contexts.scss index 1b0e602..510f79b 100644 --- a/test/_contexts.scss +++ b/test/_contexts.scss @@ -1,65 +1,68 @@ -@include describe('Contexts') { +@use 'true' as *; +@use '../src/contexts'; + +@include describe('contexts') { @include it('Creating / deleting context stacks') { - @include assert-equal(iro-context-stack-create('test'), null, 'Check if context stack was created'); - @include assert-equal(iro-context-stack-delete('test'), null, 'Check if context stack was deleted'); + @include assert-equal(contexts.create('test'), null, 'Check if context stack was created'); + @include assert-equal(contexts.delete('test'), null, 'Check if context stack was deleted'); } @include it('Adding / removing contexts') { - @include assert-equal(iro-context-stack-create('test'), null, 'Check if context stack was created'); + @include assert-equal(contexts.create('test'), null, 'Check if context stack was created'); - @include assert-equal(iro-context-push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed'); - @include assert-equal(iro-context-push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed'); - @include assert-equal(iro-context-push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed'); + @include assert-equal(contexts.push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed'); + @include assert-equal(contexts.push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed'); + @include assert-equal(contexts.push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed'); - @include assert-equal(iro-context-pop('test'), 'ctx' 56, 'Check if context 3 was popped'); - @include assert-equal(iro-context-pop('test'), 'another' 'text', 'Check if context 2 was popped'); - @include assert-equal(iro-context-pop('test'), 'ctx' 1234, 'Check if context 1 was popped'); + @include assert-equal(contexts.pop('test'), 'ctx' 56, 'Check if context 3 was popped'); + @include assert-equal(contexts.pop('test'), 'another' 'text', 'Check if context 2 was popped'); + @include assert-equal(contexts.pop('test'), 'ctx' 1234, 'Check if context 1 was popped'); - @include assert-equal(iro-context-stack-delete('test'), null, 'Check if context stack was deleted'); + @include assert-equal(contexts.delete('test'), null, 'Check if context stack was deleted'); } @include it('Clearing / counting context stacks') { - @include assert-equal(iro-context-stack-create('test'), null, 'Check if context stack was created'); + @include assert-equal(contexts.create('test'), null, 'Check if context stack was created'); - @include assert-equal(iro-context-push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed'); - @include assert-equal(iro-context-push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed'); - @include assert-equal(iro-context-push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed'); + @include assert-equal(contexts.push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed'); + @include assert-equal(contexts.push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed'); + @include assert-equal(contexts.push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed'); - @include assert-equal(iro-context-stack-count('test'), 3, 'Check if context stack contains 3 contexts'); - @include assert-equal(iro-context-pop('test'), 'ctx' 56, 'Check if context 3 was popped'); - @include assert-equal(iro-context-stack-count('test'), 2, 'Check if context stack contains 2 contexts'); - @include assert-equal(iro-context-stack-clear('test'), null, 'Check if context stack was cleared'); - @include assert-equal(iro-context-stack-count('test'), 0, 'Check if context stack contains no contexts'); + @include assert-equal(contexts.count('test'), 3, 'Check if context stack contains 3 contexts'); + @include assert-equal(contexts.pop('test'), 'ctx' 56, 'Check if context 3 was popped'); + @include assert-equal(contexts.count('test'), 2, 'Check if context stack contains 2 contexts'); + @include assert-equal(contexts.clear('test'), null, 'Check if context stack was cleared'); + @include assert-equal(contexts.count('test'), 0, 'Check if context stack contains no contexts'); - @include assert-equal(iro-context-stack-delete('test'), null, 'Check if context stack was deleted'); + @include assert-equal(contexts.delete('test'), null, 'Check if context stack was deleted'); } @include it('Retrieving contexts') { - @include assert-equal(iro-context-stack-create('test'), null, 'Check if context stack was created'); + @include assert-equal(contexts.create('test'), null, 'Check if context stack was created'); - @include assert-equal(iro-context-push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed'); - @include assert-equal(iro-context-push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed'); - @include assert-equal(iro-context-push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed'); + @include assert-equal(contexts.push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed'); + @include assert-equal(contexts.push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed'); + @include assert-equal(contexts.push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed'); - @include assert-equal(iro-context-get('test', 1), 'ctx' 56, 'Check if context at position 1 is context 3'); - @include assert-equal(iro-context-get('test', 'ctx'), 'ctx' 56, 'Check if latest context with id "ctx" is context 3'); - @include assert-equal(iro-context-get('test', 2), 'another' 'text', 'Check if latest context with id "another" is context 2'); + @include assert-equal(contexts.get('test', 1), 'ctx' 56, 'Check if context at position 1 is context 3'); + @include assert-equal(contexts.get('test', 'ctx'), 'ctx' 56, 'Check if latest context with id "ctx" is context 3'); + @include assert-equal(contexts.get('test', 2), 'another' 'text', 'Check if latest context with id "another" is context 2'); - @include assert-equal(iro-context-pop('test'), 'ctx' 56, 'Check if context 3 was popped'); + @include assert-equal(contexts.pop('test'), 'ctx' 56, 'Check if context 3 was popped'); - @include assert-equal(iro-context-get('test', 1), 'another' 'text', 'Check if context at position 1 is context 2'); - @include assert-equal(iro-context-get('test', -1), 'ctx' 1234, 'Check if latest context with id "ctx" is context 1'); + @include assert-equal(contexts.get('test', 1), 'another' 'text', 'Check if context at position 1 is context 2'); + @include assert-equal(contexts.get('test', -1), 'ctx' 1234, 'Check if latest context with id "ctx" is context 1'); - @include assert-equal(iro-context-push('test', 'more', 'string'), 'more' 'string', 'Check if context 4 was pushed'); + @include assert-equal(contexts.push('test', 'more', 'string'), 'more' 'string', 'Check if context 4 was pushed'); - @include assert-equal(iro-context-get('test', 1), 'more' 'string', 'Check if context at position 1 is context 4'); - @include assert-equal(iro-context-get('test', 'more'), 'more' 'string', 'Check if latest context with id "more" is context 4'); + @include assert-equal(contexts.get('test', 1), 'more' 'string', 'Check if context at position 1 is context 4'); + @include assert-equal(contexts.get('test', 'more'), 'more' 'string', 'Check if latest context with id "more" is context 4'); - @include assert-equal(iro-context-pop('test'), 'more' 'string', 'Check if context 4 was popped'); - @include assert-equal(iro-context-pop('test'), 'another' 'text', 'Check if context 2 was popped'); + @include assert-equal(contexts.pop('test'), 'more' 'string', 'Check if context 4 was popped'); + @include assert-equal(contexts.pop('test'), 'another' 'text', 'Check if context 2 was popped'); - @include assert-equal(iro-context-get('test', 1), iro-context-get('test', -1), 'Check if first and last context are context 1'); + @include assert-equal(contexts.get('test', 1), contexts.get('test', -1), 'Check if first and last context are context 1'); - @include assert-equal(iro-context-stack-delete('test'), null, 'Check if context stack was deleted'); + @include assert-equal(contexts.delete('test'), null, 'Check if context stack was deleted'); } } -- cgit v1.3.1