aboutsummaryrefslogtreecommitdiffstats
path: root/test/_contexts.scss
diff options
context:
space:
mode:
Diffstat (limited to 'test/_contexts.scss')
-rw-r--r--test/_contexts.scss79
1 files changed, 41 insertions, 38 deletions
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 @@
1@include describe('Contexts') { 1@use 'true' as *;
2@use '../src/contexts';
3
4@include describe('contexts') {
2 @include it('Creating / deleting context stacks') { 5 @include it('Creating / deleting context stacks') {
3 @include assert-equal(iro-context-stack-create('test'), null, 'Check if context stack was created'); 6 @include assert-equal(contexts.create('test'), null, 'Check if context stack was created');
4 @include assert-equal(iro-context-stack-delete('test'), null, 'Check if context stack was deleted'); 7 @include assert-equal(contexts.delete('test'), null, 'Check if context stack was deleted');
5 } 8 }
6 9
7 @include it('Adding / removing contexts') { 10 @include it('Adding / removing contexts') {
8 @include assert-equal(iro-context-stack-create('test'), null, 'Check if context stack was created'); 11 @include assert-equal(contexts.create('test'), null, 'Check if context stack was created');
9 12
10 @include assert-equal(iro-context-push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed'); 13 @include assert-equal(contexts.push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed');
11 @include assert-equal(iro-context-push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed'); 14 @include assert-equal(contexts.push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed');
12 @include assert-equal(iro-context-push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed'); 15 @include assert-equal(contexts.push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed');
13 16
14 @include assert-equal(iro-context-pop('test'), 'ctx' 56, 'Check if context 3 was popped'); 17 @include assert-equal(contexts.pop('test'), 'ctx' 56, 'Check if context 3 was popped');
15 @include assert-equal(iro-context-pop('test'), 'another' 'text', 'Check if context 2 was popped'); 18 @include assert-equal(contexts.pop('test'), 'another' 'text', 'Check if context 2 was popped');
16 @include assert-equal(iro-context-pop('test'), 'ctx' 1234, 'Check if context 1 was popped'); 19 @include assert-equal(contexts.pop('test'), 'ctx' 1234, 'Check if context 1 was popped');
17 20
18 @include assert-equal(iro-context-stack-delete('test'), null, 'Check if context stack was deleted'); 21 @include assert-equal(contexts.delete('test'), null, 'Check if context stack was deleted');
19 } 22 }
20 23
21 @include it('Clearing / counting context stacks') { 24 @include it('Clearing / counting context stacks') {
22 @include assert-equal(iro-context-stack-create('test'), null, 'Check if context stack was created'); 25 @include assert-equal(contexts.create('test'), null, 'Check if context stack was created');
23 26
24 @include assert-equal(iro-context-push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed'); 27 @include assert-equal(contexts.push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed');
25 @include assert-equal(iro-context-push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed'); 28 @include assert-equal(contexts.push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed');
26 @include assert-equal(iro-context-push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed'); 29 @include assert-equal(contexts.push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed');
27 30
28 @include assert-equal(iro-context-stack-count('test'), 3, 'Check if context stack contains 3 contexts'); 31 @include assert-equal(contexts.count('test'), 3, 'Check if context stack contains 3 contexts');
29 @include assert-equal(iro-context-pop('test'), 'ctx' 56, 'Check if context 3 was popped'); 32 @include assert-equal(contexts.pop('test'), 'ctx' 56, 'Check if context 3 was popped');
30 @include assert-equal(iro-context-stack-count('test'), 2, 'Check if context stack contains 2 contexts'); 33 @include assert-equal(contexts.count('test'), 2, 'Check if context stack contains 2 contexts');
31 @include assert-equal(iro-context-stack-clear('test'), null, 'Check if context stack was cleared'); 34 @include assert-equal(contexts.clear('test'), null, 'Check if context stack was cleared');
32 @include assert-equal(iro-context-stack-count('test'), 0, 'Check if context stack contains no contexts'); 35 @include assert-equal(contexts.count('test'), 0, 'Check if context stack contains no contexts');
33 36
34 @include assert-equal(iro-context-stack-delete('test'), null, 'Check if context stack was deleted'); 37 @include assert-equal(contexts.delete('test'), null, 'Check if context stack was deleted');
35 } 38 }
36 39
37 @include it('Retrieving contexts') { 40 @include it('Retrieving contexts') {
38 @include assert-equal(iro-context-stack-create('test'), null, 'Check if context stack was created'); 41 @include assert-equal(contexts.create('test'), null, 'Check if context stack was created');
39 42
40 @include assert-equal(iro-context-push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed'); 43 @include assert-equal(contexts.push('test', 'ctx', 1234), 'ctx' 1234, 'Check if context 1 was pushed');
41 @include assert-equal(iro-context-push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed'); 44 @include assert-equal(contexts.push('test', 'another', 'text'), 'another' 'text', 'Check if context 2 was pushed');
42 @include assert-equal(iro-context-push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed'); 45 @include assert-equal(contexts.push('test', 'ctx', 56), 'ctx' 56, 'Check if context 3 was pushed');
43 46
44 @include assert-equal(iro-context-get('test', 1), 'ctx' 56, 'Check if context at position 1 is context 3'); 47 @include assert-equal(contexts.get('test', 1), 'ctx' 56, 'Check if context at position 1 is context 3');
45 @include assert-equal(iro-context-get('test', 'ctx'), 'ctx' 56, 'Check if latest context with id "ctx" is context 3'); 48 @include assert-equal(contexts.get('test', 'ctx'), 'ctx' 56, 'Check if latest context with id "ctx" is context 3');
46 @include assert-equal(iro-context-get('test', 2), 'another' 'text', 'Check if latest context with id "another" is context 2'); 49 @include assert-equal(contexts.get('test', 2), 'another' 'text', 'Check if latest context with id "another" is context 2');
47 50
48 @include assert-equal(iro-context-pop('test'), 'ctx' 56, 'Check if context 3 was popped'); 51 @include assert-equal(contexts.pop('test'), 'ctx' 56, 'Check if context 3 was popped');
49 52
50 @include assert-equal(iro-context-get('test', 1), 'another' 'text', 'Check if context at position 1 is context 2'); 53 @include assert-equal(contexts.get('test', 1), 'another' 'text', 'Check if context at position 1 is context 2');
51 @include assert-equal(iro-context-get('test', -1), 'ctx' 1234, 'Check if latest context with id "ctx" is context 1'); 54 @include assert-equal(contexts.get('test', -1), 'ctx' 1234, 'Check if latest context with id "ctx" is context 1');
52 55
53 @include assert-equal(iro-context-push('test', 'more', 'string'), 'more' 'string', 'Check if context 4 was pushed'); 56 @include assert-equal(contexts.push('test', 'more', 'string'), 'more' 'string', 'Check if context 4 was pushed');
54 57
55 @include assert-equal(iro-context-get('test', 1), 'more' 'string', 'Check if context at position 1 is context 4'); 58 @include assert-equal(contexts.get('test', 1), 'more' 'string', 'Check if context at position 1 is context 4');
56 @include assert-equal(iro-context-get('test', 'more'), 'more' 'string', 'Check if latest context with id "more" is context 4'); 59 @include assert-equal(contexts.get('test', 'more'), 'more' 'string', 'Check if latest context with id "more" is context 4');
57 60
58 @include assert-equal(iro-context-pop('test'), 'more' 'string', 'Check if context 4 was popped'); 61 @include assert-equal(contexts.pop('test'), 'more' 'string', 'Check if context 4 was popped');
59 @include assert-equal(iro-context-pop('test'), 'another' 'text', 'Check if context 2 was popped'); 62 @include assert-equal(contexts.pop('test'), 'another' 'text', 'Check if context 2 was popped');
60 63
61 @include assert-equal(iro-context-get('test', 1), iro-context-get('test', -1), 'Check if first and last context are context 1'); 64 @include assert-equal(contexts.get('test', 1), contexts.get('test', -1), 'Check if first and last context are context 1');
62 65
63 @include assert-equal(iro-context-stack-delete('test'), null, 'Check if context stack was deleted'); 66 @include assert-equal(contexts.delete('test'), null, 'Check if context stack was deleted');
64 } 67 }
65} 68}