@@ -48,7 +48,7 @@ included_tests_from_toml = (path) ->
4848
4949-- ----------------------------------------------------------
5050-- functions marked as global so spec_generators can see them
51- export indent, quote, is_json_null, is_empty
51+ export indent, quote, is_json_null, is_empty, contains
5252
5353indent = ( text, level) -> string.rep ( ' ' , level) .. text
5454
@@ -63,15 +63,25 @@ is_empty = (t) -> not next t
6363-- the dkjson `json.null` value is an empty table
6464is_json_null = ( value) -> type ( value) == ' table' and is_empty( value)
6565
66+ -- a table contains a value
67+ contains = ( t, v) ->
68+ for elem in * t
69+ return true if elem == v
70+ false
71+
6672-- ----------------------------------------------------------
6773
6874
6975test_cmd = ' it'
7076
7177process = ( node, level= 0 ) ->
72- if exercise_name == ' simple-linked-list' and node. description == ' toList LIFO'
73- -- skip this whole node
74- return ' '
78+ -- exclude the test cases in this node?
79+ for exclusion in * ( spec_generator. exclusions or {} )
80+ if node[ exclusion. key]
81+ if exclusion. op == ' contains'
82+ return ' ' if contains node[ exclusion. key] , exclusion. value
83+ else
84+ return ' ' if node[ exclusion. key] == exclusion. value
7585
7686 if node. cases
7787 output = {}
0 commit comments