From 18e6481ce3738eee418922bd1d46d956bd455223 Mon Sep 17 00:00:00 2001 From: Soonho Kong Date: Mon, 15 Sep 2014 13:03:00 -0700 Subject: [PATCH] test(emacs/lean-option-test): add lean-test-update-string-alist-default --- src/emacs/test/lean-option-test.el | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/emacs/test/lean-option-test.el b/src/emacs/test/lean-option-test.el index 2b6d9a5ee..2c5950d0d 100644 --- a/src/emacs/test/lean-option-test.el +++ b/src/emacs/test/lean-option-test.el @@ -5,14 +5,28 @@ ;; (require 'ert) +(require 'lean-variable) +(require 'lean-settings) (require 'lean-option) (ert-deftest lean-test-update-string-alist () - (lean-update-option-alist "pp::implicit" 'true) + (lean-update-option-alist "pp.implicit" 'true) (should - (equal (assoc-string "pp::implicit" lean-global-option-alist) - '("pp::implicit" . true))) - (lean-update-option-alist "pp::implicit" 'false) + (equal (assoc-string "pp.implicit" lean-global-option-alist) + '("pp.implicit" . true))) + (lean-update-option-alist "pp.implicit" 'false) (should - (equal (assoc-string "pp::implicit" lean-global-option-alist) - '("pp::implicit" . false)))) + (equal (assoc-string "pp.implicit" lean-global-option-alist) + '("pp.implicit" . false)))) + +(ert-deftest lean-test-update-string-alist-default () + (setq lean-global-option-alist nil) + (should (string= (lean-option-string) + (format "-D%s=%d" + "pp.width" + lean-default-pp-width))) + (lean-update-option-alist "pp.width" 80) + (should (string= (lean-option-string) + (format "-D%s=%d" + "pp.width" + 80))))