test(emacs/lean-option-test): add lean-test-update-string-alist-default

This commit is contained in:
Soonho Kong 2014-09-15 13:03:00 -07:00
parent b650793b33
commit 18e6481ce3

View file

@ -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))))