test-ob.el: Fix and enhance tests

* testing/lisp/test-ob.el (test-ob/string-to-number): Fix and
enhance tests.
This commit is contained in:
Bastien 2020-02-19 10:56:10 +01:00
parent d0018ce62c
commit f90642e828
1 changed files with 10 additions and 8 deletions

View File

@ -2122,9 +2122,11 @@ abc
(ert-deftest test-ob/string-to-number ()
(should (= 0 (org-babel--string-to-number "0")))
(should (= 1 (org-babel--string-to-number "1")))
(should (eq nil (org-babel--string-to-number "000")))
(should (eq nil (org-babel--string-to-number "001")))
(should (eq nil (org-babel--string-to-number "010")))
(should (eq nil (org-babel--string-to-number "1 2")))
(should (= 1000.0 (org-babel--string-to-number "1e3")))
(should (eq 0 (org-babel--string-to-number "000")))
(should (eq 1 (org-babel--string-to-number "001")))
(should (eq 10 (org-babel--string-to-number "010")))
(should (= 100 (org-babel--string-to-number "100")))
(should (= 0.1 (org-babel--string-to-number "0.1")))
(should (= 1.0 (org-babel--string-to-number "1.0"))))