Mercurial > vim
comparison src/testdir/test_expr.vim @ 9986:9bef7b5d02cb v7.4.2266
commit https://github.com/vim/vim/commit/9992237a3e791fbc0c1ebf743ece1b75e1488410
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Aug 27 15:26:35 2016 +0200
patch 7.4.2266
Problem: printf() test fails on Windows. "-inf" is not used.
Solution: Check for Windows-specific values for "nan". Add sign to "inf"
when appropriate.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 27 Aug 2016 15:30:07 +0200 |
parents | 9c893592f9e6 |
children | 5ac2dd61ca8f |
comparison
equal
deleted
inserted
replaced
9985:ae33a271b103 | 9986:9bef7b5d02cb |
---|---|
202 call assert_equal('-1.200000e-02', printf('%e', -0.012)) | 202 call assert_equal('-1.200000e-02', printf('%e', -0.012)) |
203 call assert_equal('1.2', printf('%.1f', 1.23)) | 203 call assert_equal('1.2', printf('%.1f', 1.23)) |
204 | 204 |
205 call assert_equal('inf', printf('%f', 1.0/0.0)) | 205 call assert_equal('inf', printf('%f', 1.0/0.0)) |
206 | 206 |
207 " This prints inf but shouldn't it print -inf instead? | 207 call assert_match('^-inf$', printf('%f', -1.0/0.0)) |
208 call assert_match('^-\?inf$', printf('%f', -1.0/0.0)) | 208 |
209 | 209 call assert_match('^nan$', printf('%f', sqrt(-1.0))) |
210 " This prints -nan but shouldn't it print nan instead? | 210 call assert_match('^nan$', printf('%f', 0.0/0.0)) |
211 call assert_match('^-\?nan$', printf('%f', sqrt(-1.0))) | |
212 call assert_match('^-\?nan$', printf('%f', 0.0/0.0)) | |
213 | 211 |
214 call assert_fails('echo printf("%f", "a")', 'E807:') | 212 call assert_fails('echo printf("%f", "a")', 'E807:') |
215 endif | 213 endif |
216 endfunc | 214 endfunc |
217 | 215 |