File: interpolation.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 (17 lines) | stat: -rw-r--r-- 520 bytes parent folder | download | duplicates (4)
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}' eq '#' '{' 'tst}'? 'ok' : 'nok'} 9 - nested starters / stoppers"
puts "ok #{
     x = 4; x+= 1
     x+5
     } - multiline interpolation"