Created
          February 9, 2011 02:47 
        
      - 
      
- 
        Save tomill/817793 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | use strict; | |
| use warnings; | |
| use Test::More; | |
| use Text::Xslate; | |
| my $tx = Text::Xslate->new( | |
| syntax => 'TTerse', | |
| function => { | |
| return_array => sub { my @array = ('A'..'Z') }, | |
| }, | |
| ); | |
| my $r = $tx->render_string(<<'...'); | |
| [% FOR item IN [ return_array() ]; item; END -%] | |
| ... | |
| is($r, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", "list context"); | |
| done_testing(); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment