File: interpolation.t

package info (click to toggle)
nqp 2016.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 7,960 kB
  • ctags: 3,884
  • sloc: java: 25,027; perl: 910; makefile: 12; sh: 2
file content (17 lines) | stat: -rw-r--r-- 520 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
puts "1..10"
a = 2
puts "ok #{1} - num"
puts "ok #{a} - variable"
puts "ok #{a+1} - expression"
b = 'ok'
puts "#{b} #{3*(a - 1) + 1} - expression"
tst=5
puts %q<ok> " #{tst}" ' - adjacent' ' strings'
puts %Q{ok #{a*=3} - expression - side affect}
puts %Q{ok #{(a+=2)-1} - expression - side affect}
puts "#{if a==8 then 'ok' else 'nok' end} #{a} - nested statement"
puts "#{'#{tst}' == '#' '{' 'tst}'? 'ok' : 'nok'} 9 - nested starters / stoppers"
puts "ok #{
     x = 4; x+= 1
     x+5
     } - multiline interpolation"