diff options
author | Bozhidar Batsov <bozhidar@batsov.com> | 2018-01-21 21:06:32 +0200 |
---|---|---|
committer | Bozhidar Batsov <bozhidar@batsov.com> | 2018-01-21 21:06:32 +0200 |
commit | 004b090b8e2cc702fe77c23388c22e14fe904909 (patch) | |
tree | 464b6b097a231746588110b2bed96302a0ad3c63 /test/cider-repl-tests.el | |
parent | be2341d93870a1f95321aa72b25516b71bb04fe5 (diff) |
Avoid a potential error if the REPL config defcustoms are all nil
Previously in such cases we'd get a `do` expression without a body, which isn't
be nice. Now we generate the config expression only after checking it needs to
generated to begin with.
Diffstat (limited to 'test/cider-repl-tests.el')
-rw-r--r-- | test/cider-repl-tests.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/cider-repl-tests.el b/test/cider-repl-tests.el index 90fde017..0a40ac0f 100644 --- a/test/cider-repl-tests.el +++ b/test/cider-repl-tests.el @@ -142,3 +142,15 @@ PROPERTY shoudl be a symbol of either 'text, 'ansi-context or (fill-column 80)) (expect (cider--pretty-print-width) :to-equal fill-column)))) + +(describe "cider-repl--build-config-expression" + (it "returns nil when all the config values are nil" + (let ((cider-repl-print-length nil) + (cider-repl-print-level nil)) + (expect (cider-repl--build-config-expression) :to-equal nil))) + (it "returns an when any the config values are non-nil" + (let ((cider-repl-print-length 10) + (cider-repl-print-level 10)) + (expect (cider-repl--build-config-expression) + :to-equal + "(do (set! *print-length* 10) (set! *print-level* 10))")))) |