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:
parent
d0018ce62c
commit
f90642e828
|
@ -2120,14 +2120,16 @@ abc
|
||||||
(org-babel-execute-src-block))))))
|
(org-babel-execute-src-block))))))
|
||||||
|
|
||||||
(ert-deftest test-ob/string-to-number ()
|
(ert-deftest test-ob/string-to-number ()
|
||||||
(should (= 0 (org-babel--string-to-number "0")))
|
(should (= 0 (org-babel--string-to-number "0")))
|
||||||
(should (= 1 (org-babel--string-to-number "1")))
|
(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 "1 2")))
|
||||||
(should (eq nil (org-babel--string-to-number "001")))
|
(should (= 1000.0 (org-babel--string-to-number "1e3")))
|
||||||
(should (eq nil (org-babel--string-to-number "010")))
|
(should (eq 0 (org-babel--string-to-number "000")))
|
||||||
(should (= 100 (org-babel--string-to-number "100")))
|
(should (eq 1 (org-babel--string-to-number "001")))
|
||||||
(should (= 0.1 (org-babel--string-to-number "0.1")))
|
(should (eq 10 (org-babel--string-to-number "010")))
|
||||||
(should (= 1.0 (org-babel--string-to-number "1.0"))))
|
(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"))))
|
||||||
|
|
||||||
(provide 'test-ob)
|
(provide 'test-ob)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue