xml-axkit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject cvs commit: xml-axkit/t 11xsp_attr_value_template.t
Date Thu, 07 Aug 2003 10:13:04 GMT
matts       2003/08/07 03:13:04

  Added:       t        11xsp_attr_value_template.t
  Log:
  Test for attribute value templates. (NB: Currently fails)
  
  Revision  Changes    Path
  1.1                  xml-axkit/t/11xsp_attr_value_template.t
  
  Index: 11xsp_attr_value_template.t
  ===================================================================
  use Test;
  BEGIN { plan tests => 12 }
  use Apache::AxKit::Language::XSP;
  
  # Test for attribute value templates
  
  my $e = {};
  
  {
      # test no curlies is OK
      my $value = 'value';
      my $result = AxKit::XSP::DefaultHandler::_attr_value_template($e, $value);
      ok($result);
      ok($result !~ /do/);
      print $result, "\n";
      eval $result;
      ok(!$@);
  }
  
  {
      # test 1 curly is OK
      my $value = 'value {{';
      my $result = AxKit::XSP::DefaultHandler::_attr_value_template($e, $value);
      ok($result);
      ok($result !~ /do/);
      print $result, "\n";
      eval $result;
      ok(!$@);
  }
  
  {
      # test expr is OK
      my $value = 'value {time()}';
      my $result = AxKit::XSP::DefaultHandler::_attr_value_template($e, $value);
      ok($result);
      ok($result =~ /do/);
      print $result, "\n";
      eval $result;
      ok(!$@);
  }
  
  {
      # test 2 expr is OK
      my $value = 'value {time()} text {time()}';
      my $result = AxKit::XSP::DefaultHandler::_attr_value_template($e, $value);
      ok($result);
      ok($result =~ /do/);
      print $result, "\n";
      eval $result;
      ok(!$@);
  }
  
  
  
  

Mime
View raw message