texinfo-commits
[Top][All Lists]
Advanced

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

texinfo/tp/t automatic_nodes.t


From: Patrice Dumas
Subject: texinfo/tp/t automatic_nodes.t
Date: Sun, 04 Mar 2012 23:46:41 +0000

CVSROOT:        /sources/texinfo
Module name:    texinfo
Changes by:     Patrice Dumas <pertusus>        12/03/04 23:46:41

Modified files:
        tp/t           : automatic_nodes.t 

Log message:
        Test empty node.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/texinfo/tp/t/automatic_nodes.t?cvsroot=texinfo&r1=1.7&r2=1.8

Patches:
Index: automatic_nodes.t
===================================================================
RCS file: /sources/texinfo/texinfo/tp/t/automatic_nodes.t,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- automatic_nodes.t   4 Mar 2012 23:22:24 -0000       1.7
+++ automatic_nodes.t   4 Mar 2012 23:46:41 -0000       1.8
@@ -1,7 +1,7 @@
 use strict;
 
 use Test::More;
-BEGIN { plan tests => 21 };
+BEGIN { plan tests => 23 };
 
 use lib 'maintain/lib/Unicode-EastAsianWidth/lib/';
 use lib 'maintain/lib/libintl-perl/lib/';
@@ -24,12 +24,16 @@
   my $parser = Texinfo::Parser::parser();
   my $line = $parser->parse_texi_line ($in);
   my $node = Texinfo::Structuring::_new_node($parser, $line);
-  my $texi_result = Texinfo::Convert::Texinfo::convert($node);
-  my $normalized = $node->{'extra'}->{'normalized'};
+  
+  my ($texi_result, $normalized);
+  if (defined($node)) {
+    $texi_result = Texinfo::Convert::Texinfo::convert($node);
+    $normalized = $node->{'extra'}->{'normalized'};
   my $labels = $parser->labels_information();
   my @labels = keys(%$labels);
   ok ((scalar(@labels) == 1 and $labels[0] eq $normalized), "$name label");
-  if (!defined($normalized_ref)) {
+  }
+  if (!defined($normalized_ref) and defined($normalized)) {
     print STDERR " --> $name($normalized): $texi_result";
   } else {
     is ($normalized_ref, $normalized, "$name normalized");
@@ -53,6 +57,7 @@
 '@node changed @code{node} and (@samp{file})
 ', 
 'ref in new node');
+test_new_node ('@asis{}', undef, undef, 'empty node');
 
 my $parser = Texinfo::Parser::parser();
 my $tree = $parser->parse_texi_text('@node a node



reply via email to

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