0
0
mirror of https://github.com/vim/vim.git synced 2025-10-02 05:04:20 -04:00

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.
This commit is contained in:
Bram Moolenaar
2016-08-27 15:26:35 +02:00
parent 76efafba2a
commit 9992237a3e
3 changed files with 32 additions and 7 deletions

View File

@@ -204,12 +204,10 @@ function Test_printf_float()
call assert_equal('inf', printf('%f', 1.0/0.0))
" This prints inf but shouldn't it print -inf instead?
call assert_match('^-\?inf$', printf('%f', -1.0/0.0))
call assert_match('^-inf$', printf('%f', -1.0/0.0))
" This prints -nan but shouldn't it print nan instead?
call assert_match('^-\?nan$', printf('%f', sqrt(-1.0)))
call assert_match('^-\?nan$', printf('%f', 0.0/0.0))
call assert_match('^nan$', printf('%f', sqrt(-1.0)))
call assert_match('^nan$', printf('%f', 0.0/0.0))
call assert_fails('echo printf("%f", "a")', 'E807:')
endif