core: fix error when a layer is not found
This commit is contained in:
parent
c0ec9faa56
commit
a0cbcd4a5d
|
@ -306,7 +306,7 @@ path."
|
|||
(defun configuration-layer//declare-used-layers (layers)
|
||||
"Declare the passed configuration LAYERS.
|
||||
LAYERS is a list of layer symbols."
|
||||
(reduce (lambda (acc elt) (push elt acc))
|
||||
(reduce (lambda (acc elt) (if elt (push elt acc) acc))
|
||||
(mapcar 'configuration-layer//make-used-layer (reverse layers))
|
||||
:initial-value nil))
|
||||
|
||||
|
|
|
@ -26,6 +26,17 @@
|
|||
(result (configuration-layer//declare-used-layers input)))
|
||||
(should (equal result input)))))
|
||||
|
||||
(ert-deftest test-declare-used-layers--ignore-not-found-layer ()
|
||||
(mocker-let ((configuration-layer//make-used-layer
|
||||
(x)
|
||||
((:input '(layer3) :output 'layer3)
|
||||
(:input '(layer2-not-found) :output nil)
|
||||
(:input '(layer1) :output 'layer1))))
|
||||
(let* ((input '(layer1 layer2-not-found layer3))
|
||||
(expected '(layer1 layer3))
|
||||
(result (configuration-layer//declare-used-layers input)))
|
||||
(should (equal result expected)))))
|
||||
|
||||
;; ---------------------------------------------------------------------------
|
||||
;; configuration-layer//make-used-layer
|
||||
;; ---------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue