2010-03-05 17:30:49 -05:00
|
|
|
hello: 'Hello'
|
|
|
|
world: 'World'
|
|
|
|
ok '$hello $world!' is '$hello $world!'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok '${hello} ${world}!' is '${hello} ${world}!'
|
2010-03-05 17:30:49 -05:00
|
|
|
ok "$hello $world!" is 'Hello World!'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok "${hello} ${world}!" is 'Hello World!'
|
2010-03-05 17:30:49 -05:00
|
|
|
ok "[$hello$world]" is '[HelloWorld]'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok "[${hello}${world}]" is '[HelloWorld]'
|
2010-03-05 17:30:49 -05:00
|
|
|
ok "$hello$$world" is 'Hello$World'
|
2010-03-05 19:22:03 -05:00
|
|
|
ok "${hello}$${world}" is 'Hello$World'
|
2010-03-05 17:30:49 -05:00
|
|
|
|
|
|
|
[s, t, r, i, n, g]: ['s', 't', 'r', 'i', 'n', 'g']
|
|
|
|
ok "$s$t$r$i$n$g" is 'string'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok "${s}${t}${r}${i}${n}${g}" is 'string'
|
2010-03-05 17:30:49 -05:00
|
|
|
ok "\\$s\\$t\\$r\\$i\\$n\\$g" is '$s$t$r$i$n$g'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok "\\${s}\\${t}\\${r}\\${i}\\${n}\\${g}" is '${s}${t}${r}${i}${n}${g}'
|
2010-03-05 17:30:49 -05:00
|
|
|
ok "\\$string" is '$string'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok "\\${string}" is '${string}'
|
2010-03-05 17:30:49 -05:00
|
|
|
|
|
|
|
ok "\\$Escaping first" is '$Escaping first'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok "\\${Escaping} first" is '${Escaping} first'
|
2010-03-05 17:30:49 -05:00
|
|
|
ok "Escaping \\$in middle" is 'Escaping $in middle'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok "Escaping \\${in} middle" is 'Escaping ${in} middle'
|
2010-03-05 17:30:49 -05:00
|
|
|
ok "Escaping \\$last" is 'Escaping $last'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok "Escaping \\${last}" is 'Escaping ${last}'
|
2010-03-05 17:30:49 -05:00
|
|
|
|
|
|
|
ok "$$" is '$$'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok "${}" is '${}'
|
2010-03-05 17:30:49 -05:00
|
|
|
ok "\\\\$$" is '\\\\$$'
|
2010-03-05 19:15:27 -05:00
|
|
|
ok "\\\\${}" is '\\\\${}'
|
|
|
|
|
|
|
|
ok "I won $20 last night." is 'I won $20 last night.'
|
|
|
|
ok "I won $${20} last night." is 'I won $20 last night.'
|
|
|
|
ok "I won $#20 last night." is 'I won $#20 last night.'
|
|
|
|
ok "I won $${'#20'} last night." is 'I won $#20 last night.'
|
|
|
|
|
|
|
|
ok "${hello + world}" is 'HelloWorld'
|
|
|
|
ok "${hello + ' ' + world + '!'}" is 'Hello World!'
|
|
|
|
|
|
|
|
list: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
|
|
|
|
ok "values: ${list.join(', ')}, length: ${list.length}." is 'values: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, length: 10.'
|
|
|
|
ok "values: ${list.join ' '}" is 'values: 0 1 2 3 4 5 6 7 8 9'
|