2017-02-05 23:22 GMT+09:00 h_east <[email protected]>:

> Hi Kazunobu,
>
> 2017-2-5(Sun) 23:03:59 UTC+9 Kazunobu Kuriyama:
> > Hi,
> >
> >
> > Attached is a tiny, trivial supplement to test_gui.  Any comments and/or
> suggestions are welcome, as you all know, I'm not used to writing new tests
> for Vim :)
>
> +  call assert_true(1, match(execute('echo getwinposx()'),
> '\(%-1\)\|\(%\d\+\)') >= 0)
> +  call assert_true(1, match(execute('echo getwinposy()'),
> '\(%-1\)\|\(%\d\+\)') >= 0)
> ...
> +  if s:x11_based_gui
> +    call assert_true(1, match(execute('echo v:windowid'), '\d\+') >= 0)
>
> Where the `assert_true()` is used arguments are strange.
> The first argument is unnecessary.
> Please see the document. (:h assert_true())
> Alternatively, use `assert_equal()` with the arguments intact.
>

Oh my...  Then, in addition to them, you think the existing test:

> call assert_true(1, match(execute('winpos'), 'Window position: X \d\+, Y
\d\+'  <<<<) >= 0)

should also be corrected, right?

Along that line, I revised the patch.  I'd be happy if you could check it.

Thank you,
Kazunobu

>
> --
> Best regards,
> Hirohito Higashi (a.k.a. h_east)
>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/testdir/test_gui.vim b/src/testdir/test_gui.vim
index 14c0ca1f4..3ec58b21f 100644
--- a/src/testdir/test_gui.vim
+++ b/src/testdir/test_gui.vim
@@ -4,6 +4,8 @@ if !has('gui') || ($DISPLAY == "" && !has('gui_running'))
   finish
 endif
 
+let s:x11_based_gui = has('gui_athena') || has('gui_motif') || has('gui_gtk2') 
|| has('gui_gnome') || has('gui_gtk3')
+
 " For KDE set a font, empty 'guifont' may cause a hang.
 func SetUp()
   if has("gui_kde")
@@ -32,10 +34,23 @@ func Test_1_set_secure()
   call assert_equal(1, has('gui_running'))
 endfunc
 
+func Test_function()
+  call assert_true(match(execute('echo getwinposx()'), '\(-1\)\|\(\d\+\)') >= 
0)
+  call assert_true(match(execute('echo getwinposy()'), '\(-1\)\|\(\d\+\)') >= 
0)
+endfunction
+
 func Test_shell_command()
   new
   r !echo hello
   call assert_equal('hello', substitute(getline(2), '\W', '', 'g'))
   bwipe!
-  call assert_true(1, match(execute('winpos'), 'Window position: X \d\+, Y 
\d\+') >= 0)
+  call assert_true(match(execute('winpos'), 'Window position: X \d\+, Y \d\+') 
>= 0)
 endfunc
+
+func Test_vim_variable()
+  if s:x11_based_gui
+    call assert_true(match(execute('echo v:windowid'), '\d\+') >= 0)
+  else
+    call assert_equal(0, v:windowid)
+  endif
+endfunction

Raspunde prin e-mail lui