diff --git a/tests/samples/if.yml b/tests/samples/if.yml index 9604e67..bdde5f5 100644 --- a/tests/samples/if.yml +++ b/tests/samples/if.yml @@ -8,15 +8,10 @@ b: 2 !if false: e: 5 f: 6 -!if true: - g: - - ? !if true - : - 7 + --- # output a: 1 b: 2 c: 3 d: 4 -g: - - 7 \ No newline at end of file diff --git a/tests/samples/overlay.yml b/tests/samples/overlay.yml deleted file mode 100644 index 0ff4f58..0000000 --- a/tests/samples/overlay.yml +++ /dev/null @@ -1,33 +0,0 @@ -#input -left: !- - a: - b: !? 2 - c: 1 - -right: !- - a: - b: !? 3 - d: 4 - -# Recursive mapping merge with customization implemented in YAQL. -# Will probably be available in some way as a function in future versions of Yglu. -merge: !() - let(arg => $) -> - switch( - $.l = $.L.a => $.r + $.l + { b => $.r.b + $.l.b }, - isDict($.r) => dict($.l.items() + $.r.items() + - set($.r.keys()).intersect(set($.l.keys())) - .select([$, ($_.merge)({l => $arg.l[$], r => $arg.r[$], L => $arg.L, R => $arg.R})]) - ), - true => $.l - ) - -merged: !? ($_.merge)({l => $_.left, r => $_.right, L => $_.left, R => $_.right, p => ''}) - ---- -# output -merged: - a: - b: 5 - c: 1 - d: 4 \ No newline at end of file diff --git a/tests/test_samples.py b/tests/test_samples.py index c3a5f11..d040627 100644 --- a/tests/test_samples.py +++ b/tests/test_samples.py @@ -22,5 +22,12 @@ def simple_name(filename): @pytest.mark.parametrize("filename", files) def test_sample(filename): with open(filename) as file_handle: - (input, output) = process_all(file_handle, filename) + (input, output) = process_all(file_handle, filename, FailingErrorHandler()) assert_like(input, output) + +class FailingErrorHandler(list): + def __init__(self): + self.nodes = set() + + def append(self, error): + raise error