summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-08-27 15:26:35 +0200
committerBram Moolenaar <Bram@vim.org>2016-08-27 15:26:35 +0200
commit9992237a3e791fbc0c1ebf743ece1b75e1488410 (patch)
tree1016f2132eb5318b0136ce8ad71921177322a5fb /src/testdir
parent76efafba2af36ae5f6c7b79b56c537fcbcdb386c (diff)
downloadvim-git-9992237a3e791fbc0c1ebf743ece1b75e1488410.tar.gz
patch 7.4.2266v7.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.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_expr.vim8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/testdir/test_expr.vim b/src/testdir/test_expr.vim
index 49d6c3a37..6f1de59c9 100644
--- a/src/testdir/test_expr.vim
+++ b/src/testdir/test_expr.vim
@@ -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