diff options
Diffstat (limited to 'test')
| -rw-r--r-- | test/lisp/calc/calc-tests.el | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/test/lisp/calc/calc-tests.el b/test/lisp/calc/calc-tests.el index 92f74976b00..77d939eb406 100644 --- a/test/lisp/calc/calc-tests.el +++ b/test/lisp/calc/calc-tests.el | |||
| @@ -168,6 +168,32 @@ An existing calc stack is reused, otherwise a new one is created." | |||
| 168 | (should (equal (math-simplify '(calcFunc-cot (/ (var pi var-pi) 3))) | 168 | (should (equal (math-simplify '(calcFunc-cot (/ (var pi var-pi) 3))) |
| 169 | '(calcFunc-cot (/ (var pi var-pi) 3))))))) | 169 | '(calcFunc-cot (/ (var pi var-pi) 3))))))) |
| 170 | 170 | ||
| 171 | (ert-deftest calc-test-format-radix () | ||
| 172 | "Test integer formatting (bug#36689)." | ||
| 173 | (let ((calc-group-digits nil)) | ||
| 174 | (let ((calc-number-radix 10)) | ||
| 175 | (should (equal (math-format-number 12345678901) "12345678901"))) | ||
| 176 | (let ((calc-number-radix 2)) | ||
| 177 | (should (equal (math-format-number 12345) "2#11000000111001"))) | ||
| 178 | (let ((calc-number-radix 8)) | ||
| 179 | (should (equal (math-format-number 12345678901) "8#133767016065"))) | ||
| 180 | (let ((calc-number-radix 16)) | ||
| 181 | (should (equal (math-format-number 12345678901) "16#2DFDC1C35"))) | ||
| 182 | (let ((calc-number-radix 36)) | ||
| 183 | (should (equal (math-format-number 12345678901) "36#5O6AQT1")))) | ||
| 184 | (let ((calc-group-digits t)) | ||
| 185 | (let ((calc-number-radix 10)) | ||
| 186 | (should (equal (math-format-number 12345678901) "12,345,678,901"))) | ||
| 187 | (let ((calc-number-radix 2)) | ||
| 188 | (should (equal (math-format-number 12345) "2#11,0000,0011,1001"))) | ||
| 189 | (let ((calc-number-radix 8)) | ||
| 190 | (should (equal (math-format-number 12345678901) "8#133,767,016,065"))) | ||
| 191 | (let ((calc-number-radix 16)) | ||
| 192 | (should (equal (math-format-number 12345678901) "16#2,DFDC,1C35"))) | ||
| 193 | (let ((calc-number-radix 36)) | ||
| 194 | (should (equal (math-format-number 12345678901) "36#5,O6A,QT1"))))) | ||
| 195 | |||
| 196 | |||
| 171 | (provide 'calc-tests) | 197 | (provide 'calc-tests) |
| 172 | ;;; calc-tests.el ends here | 198 | ;;; calc-tests.el ends here |
| 173 | 199 | ||