File: template.t

package info (click to toggle)
nqp 2024.09%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 9,972 kB
  • sloc: java: 28,087; perl: 3,479; ansic: 451; makefile: 202; javascript: 68; sh: 1
file content (23 lines) | stat: -rw-r--r-- 637 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# eRubyish style templates

puts '1..10'
puts "ok 1 - statements before template"

<?rbi?>
ok 2 - initial template text
  <%n = 2 %>
  <%while (n+=1) < 5 %>ok #{n} - while loop test
  <%end%>
ok 5 - text between statements
  <%if n == 5 %>ok 6 - if block (true)
  <%else      %>nok 6 - else block (true)
  <%end%>
  <%if    n == 1234 %>nok 7 - if block (false)
  <%elsif n == 20   %>nok 7 - elsif block (false)
  <%else            %>ok 7 - else block (false)
  <% end %>
  <%for test in [8, 9] do %>ok #{test} - for loop test
  <%end%>
  <%n = 9 %>
<%#puts "nok #{n += 1} - commented out directive" %>
ok #{n += 1} - final template text