texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[5867] tests and fixes for index lookup


From: Gavin D. Smith
Subject: [5867] tests and fixes for index lookup
Date: Thu, 09 Oct 2014 13:07:24 +0000

Revision: 5867
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=5867
Author:   gavin
Date:     2014-10-09 13:07:23 +0000 (Thu, 09 Oct 2014)
Log Message:
-----------
tests and fixes for index lookup

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/info/Makefile.am
    trunk/info/indices.c

Added Paths:
-----------
    trunk/info/t/index-completing.sh
    trunk/info/t/infodir/index-search.info
    trunk/info/t/no-index.sh

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2014-10-08 19:28:17 UTC (rev 5866)
+++ trunk/ChangeLog     2014-10-09 13:07:23 UTC (rev 5867)
@@ -1,3 +1,12 @@
+2014-10-09  Gavin Smith  <address@hidden>
+
+       * info/indices.c (info_index_search): Call 
+       info_indices_of_file_buffer before prompting user.  Display an 
+       error message if no index is found.
+       (info_virtual_index): Match error message to that used 
+       elsewhere.
+       * info/t/no-index.sh, info/t/index-completing.sh: New tests.
+
 2014-10-08  Gavin Smith  <address@hidden>
 
        * info/indices.c (info_index_search): Don't duplicate a string 

Modified: trunk/info/Makefile.am
===================================================================
--- trunk/info/Makefile.am      2014-10-08 19:28:17 UTC (rev 5866)
+++ trunk/info/Makefile.am      2014-10-09 13:07:23 UTC (rev 5867)
@@ -119,8 +119,10 @@
        t/search-after-tag.sh \
        t/split-file-menu.sh \
        t/index.sh \
+       t/no-index.sh \
        t/index-apropos.sh \
        t/index-search.sh \
+       t/index-completing.sh \
        t/split-index.sh \
        t/index-long-nodeline.sh \
        t/menu-sequence.sh \

Modified: trunk/info/indices.c
===================================================================
--- trunk/info/indices.c        2014-10-08 19:28:17 UTC (rev 5866)
+++ trunk/info/indices.c        2014-10-09 13:07:23 UTC (rev 5867)
@@ -202,6 +202,16 @@
   char *line;
   int old_offset;
 
+  fb = file_buffer_of_window (window);
+  if (fb)
+    info_indices_of_file_buffer (fb); /* Sets index_index. */
+
+  if (!fb || !index_index)
+    {
+      info_error (_("No indices found."));
+      return;
+    }
+
   line = info_read_maybe_completing (_("Index entry: "), index_index);
 
   /* User aborted? */
@@ -216,7 +226,6 @@
     {
       free (line);
 
-      info_indices_of_file_buffer (file_buffer_of_window (window));
       if (initial_index_filename && initial_index_nodename)
         {
           NODE *node;
@@ -228,10 +237,6 @@
       return;
     }
 
-  fb = file_buffer_of_window (window);
-  if (!fb)
-    return;
-
   /* Reset the index offset. */
   index_offset = 0;
 
@@ -770,7 +775,7 @@
 
   if (!index_index)
     {
-      info_error (_("No index"));
+      info_error (_("No indices found."));
       return;
     }
     

Added: trunk/info/t/index-completing.sh
===================================================================
--- trunk/info/t/index-completing.sh                            (rev 0)
+++ trunk/info/t/index-completing.sh    2014-10-09 13:07:23 UTC (rev 5867)
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+srcdir=${srcdir:-.}
+. $srcdir/t/Init-test.inc
+. $t/Init-inter.inc
+
+run_ginfo -f index-search
+# Check that pressing tab to complete works for index search
+printf 'i\t\rDq' >$PTY_TYPE
+. $t/Timeout-test.inc
+
+grep '^Node: Node 2' $GINFO_OUTPUT
+RETVAL=$?
+
+. $t/Cleanup.inc
+


Property changes on: trunk/info/t/index-completing.sh
___________________________________________________________________
Added: svn:executable
   + *

Added: trunk/info/t/infodir/index-search.info
===================================================================
(Binary files differ)


Property changes on: trunk/info/t/infodir/index-search.info
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: trunk/info/t/no-index.sh
===================================================================
--- trunk/info/t/no-index.sh                            (rev 0)
+++ trunk/info/t/no-index.sh    2014-10-09 13:07:23 UTC (rev 5867)
@@ -0,0 +1,27 @@
+#!/bin/sh
+# Copyright (C) 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+srcdir=${srcdir:-.}
+. $srcdir/t/Init-test.inc
+. $t/Init-inter.inc
+
+run_ginfo -f sample
+# Try to search in the indices when there aren't any
+printf 'ia\rq' >$PTY_TYPE
+. $t/Timeout-test.inc
+
+. $t/Cleanup.inc
+


Property changes on: trunk/info/t/no-index.sh
___________________________________________________________________
Added: svn:executable
   + *




reply via email to

[Prev in Thread] Current Thread [Next in Thread]